diff --git a/cmd/ls.go b/cmd/ls.go index 1485a90..be3ffd9 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -10,11 +10,12 @@ var ( ) func init() { - fs := flag.NewFlagSet("toggle", flag.ExitOnError) + var cmdName string = "ls" + fs := flag.NewFlagSet(cmdName, flag.ExitOnError) selector := fs.String("selector", "all", "Set the selector") fs.StringVar(selector, "s", "all", "Set the selector") - RegisterCommand("ls", Command{ + RegisterCommand(cmdName, Command{ Func: LsCmd, Flags: fs, }) diff --git a/cmd/toggle.go b/cmd/toggle.go index c441b93..ef7e940 100644 --- a/cmd/toggle.go +++ b/cmd/toggle.go @@ -6,13 +6,15 @@ import ( ) func init() { - fs := flag.NewFlagSet("toggle", flag.ExitOnError) + var cmdName string = "set-state" + + fs := flag.NewFlagSet(cmdName, flag.ExitOnError) duration := fs.Float64("duration", 1.0, "Set the duration") fs.Float64Var(duration, "d", 1.0, "Set the duration") selector := fs.String("selector", "all", "Set the selector") fs.StringVar(selector, "s", "all", "Set the selector") - RegisterCommand("toggle", Command{ + RegisterCommand(cmdName, Command{ Func: ToggleCmd, Flags: fs, })