lume/cmd/toggle.go

14 lines
304 B
Go
Raw Normal View History

2020-03-27 00:05:50 +00:00
package lumecmd
2020-03-29 05:08:17 +00:00
func ToggleCmd(args CmdArgs) (int, error) {
2020-03-27 00:05:50 +00:00
c := args.Client
duration := args.Flags.Float64("duration")
selector := args.Flags.String("selector")
r, err := c.Toggle(selector, duration)
if err != nil {
2021-01-31 17:08:24 +00:00
return ExitFailure, err
2020-03-27 00:05:50 +00:00
}
2020-03-27 07:01:14 +00:00
PrintResults(r.Results)
return ExitSuccess, nil
2020-03-27 00:05:50 +00:00
}