store CLI defaults into variables
This commit is contained in:
@ -9,10 +9,12 @@ func init() {
|
||||
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")
|
||||
|
||||
duration := fs.Float64("duration", defaultDuration, "Set the duration")
|
||||
fs.Float64Var(duration, "d", defaultDuration, "Set the duration")
|
||||
|
||||
selector := fs.String("selector", defaultSelector, "Set the selector")
|
||||
fs.StringVar(selector, "s", defaultSelector, "Set the selector")
|
||||
|
||||
RegisterCommand(cmdName, Command{
|
||||
Func: ToggleCmd,
|
||||
|
Reference in New Issue
Block a user