7
7
8
8
var (
9
9
host string
10
- username string
11
- password string
12
- thingID string
10
+ device string
11
+ secret string
12
+ thing string
13
13
troubleshooting bool
14
14
)
15
15
@@ -21,26 +21,26 @@ func NewCommand() *cobra.Command {
21
21
RunE : runPingCommand ,
22
22
}
23
23
24
- pingCommand .Flags ().StringVarP (& host , "host" , "b" , "tcps://mqtts-up.iot.arduino.cc:8884" , "Broker endpoint " )
25
- pingCommand .Flags ().StringVarP (& username , "username " , "u " , "" , "Username (required) " )
26
- pingCommand .Flags ().StringVarP (& password , "password " , "p " , "" , "Password (required) " )
27
- pingCommand .Flags ().StringVarP (& thingID , "thing_id " , "t" , "" , "Thing ID (required) " )
24
+ pingCommand .Flags ().StringVarP (& host , "host" , "b" , "tcps://mqtts-up.iot.arduino.cc:8884" , "MQTT Broker URL " )
25
+ pingCommand .Flags ().StringVarP (& device , "device " , "d " , "" , "Device ID " )
26
+ pingCommand .Flags ().StringVarP (& secret , "secret " , "s " , "" , "Device Secret " )
27
+ pingCommand .Flags ().StringVarP (& thing , "thing " , "t" , "" , "Thing ID" )
28
28
29
29
pingCommand .Flags ().BoolVar (& troubleshooting , "troubleshooting" , false , "Enable troubleshooting mode (full logs from the MQTT client)" )
30
30
31
- pingCommand .MarkFlagRequired ("username " )
32
- pingCommand .MarkFlagRequired ("password " )
33
- pingCommand .MarkFlagRequired ("thing_id " )
31
+ pingCommand .MarkFlagRequired ("device " )
32
+ pingCommand .MarkFlagRequired ("secret " )
33
+ pingCommand .MarkFlagRequired ("thing " )
34
34
35
35
return pingCommand
36
36
}
37
37
38
38
func runPingCommand (cmd * cobra.Command , args []string ) error {
39
39
params := & ping.Params {
40
40
Host : host ,
41
- Username : username ,
42
- Password : password ,
43
- ThingID : thingID ,
41
+ Username : device ,
42
+ Password : secret ,
43
+ ThingID : thing ,
44
44
Troubleshooting : troubleshooting ,
45
45
}
46
46
0 commit comments