@@ -28,7 +28,7 @@ import (
28
28
)
29
29
30
30
func init () {
31
- loopCmd .AddCommand (newTestLoopPublicCommand ().cmd )
31
+ testLoopCmd .AddCommand (newTestLoopPublicCommand ().cmd )
32
32
}
33
33
34
34
type testLoopPublicCommand struct {
@@ -50,22 +50,22 @@ func newTestLoopPublicCommand() *testLoopPublicCommand {
50
50
cmd := & cobra.Command {
51
51
Use : "public" ,
52
52
Short : "Start a loop agent testing public proxy shares" ,
53
- Args : cobra .ExactArgs ( 0 ) ,
53
+ Args : cobra .NoArgs ,
54
54
}
55
- r := & testLoopPublicCommand {cmd : cmd }
56
- cmd .Run = r .run
57
- cmd .Flags ().IntVarP (& r .loopers , "loopers" , "l" , 1 , "Number of current loopers to start" )
58
- cmd .Flags ().IntVarP (& r .iterations , "iterations" , "i" , 1 , "Number of iterations per looper" )
59
- cmd .Flags ().IntVarP (& r .statusEvery , "status-every" , "E" , 100 , "Show status every # iterations" )
60
- cmd .Flags ().IntVarP (& r .timeoutSeconds , "timeout-seconds" , "T" , 30 , "Time out after # seconds when sending http requests" )
61
- cmd .Flags ().IntVar (& r .minPayload , "min-payload" , 64 , "Minimum payload size in bytes" )
62
- cmd .Flags ().IntVar (& r .maxPayload , "max-payload" , 10240 , "Maximum payload size in bytes" )
63
- cmd .Flags ().IntVar (& r .minDwellMs , "min-dwell-ms" , 1000 , "Minimum dwell time in milliseconds" )
64
- cmd .Flags ().IntVar (& r .maxDwellMs , "max-dwell-ms" , 1000 , "Maximum dwell time in milliseconds" )
65
- cmd .Flags ().IntVar (& r .minPacingMs , "min-pacing-ms" , 0 , "Minimum pacing in milliseconds" )
66
- cmd .Flags ().IntVar (& r .maxPacingMs , "max-pacing-ms" , 0 , "Maximum pacing in milliseconds" )
67
- cmd .Flags ().StringArrayVar (& r .frontendSelection , "frontends" , []string {"public" }, "Selected frontends to use for the share" )
68
- return r
55
+ command := & testLoopPublicCommand {cmd : cmd }
56
+ cmd .Run = command .run
57
+ cmd .Flags ().IntVarP (& command .loopers , "loopers" , "l" , 1 , "Number of current loopers to start" )
58
+ cmd .Flags ().IntVarP (& command .iterations , "iterations" , "i" , 1 , "Number of iterations per looper" )
59
+ cmd .Flags ().IntVarP (& command .statusEvery , "status-every" , "E" , 100 , "Show status every # iterations" )
60
+ cmd .Flags ().IntVarP (& command .timeoutSeconds , "timeout-seconds" , "T" , 30 , "Time out after # seconds when sending http requests" )
61
+ cmd .Flags ().IntVar (& command .minPayload , "min-payload" , 64 , "Minimum payload size in bytes" )
62
+ cmd .Flags ().IntVar (& command .maxPayload , "max-payload" , 10240 , "Maximum payload size in bytes" )
63
+ cmd .Flags ().IntVar (& command .minDwellMs , "min-dwell-ms" , 1000 , "Minimum dwell time in milliseconds" )
64
+ cmd .Flags ().IntVar (& command .maxDwellMs , "max-dwell-ms" , 1000 , "Maximum dwell time in milliseconds" )
65
+ cmd .Flags ().IntVar (& command .minPacingMs , "min-pacing-ms" , 0 , "Minimum pacing in milliseconds" )
66
+ cmd .Flags ().IntVar (& command .maxPacingMs , "max-pacing-ms" , 0 , "Maximum pacing in milliseconds" )
67
+ cmd .Flags ().StringArrayVar (& command .frontendSelection , "frontends" , []string {"public" }, "Selected frontends to use for the share" )
68
+ return command
69
69
}
70
70
71
71
func (cmd * testLoopPublicCommand ) run (_ * cobra.Command , _ []string ) {
0 commit comments