14 lines
304 B
Go
14 lines
304 B
Go
package lumecmd
|
|
|
|
func ToggleCmd(args CmdArgs) (int, error) {
|
|
c := args.Client
|
|
duration := args.Flags.Float64("duration")
|
|
selector := args.Flags.String("selector")
|
|
r, err := c.Toggle(selector, duration)
|
|
if err != nil {
|
|
return ExitFailure, err
|
|
}
|
|
PrintResults(r.Results)
|
|
return ExitSuccess, nil
|
|
}
|