Refactor global flags
This commit is contained in:
@ -34,8 +34,6 @@ func NewCmdSetState() Command {
|
||||
fast := fs.Bool("fast", defaultFast, "fast state")
|
||||
fs.BoolVar(fast, "f", defaultFast, "fast state")
|
||||
|
||||
fs.String("format", defaultOutputFormat, "Set the output format")
|
||||
|
||||
return fs
|
||||
}(),
|
||||
Use: "[--selector <selector>] [--power (on|off)] [--color <color>] [--brightness <brightness>] [--duration <sec>] [--infrared <infrared>] [--fast]",
|
||||
@ -49,7 +47,7 @@ func SetStateCmd(ctx Context) (int, error) {
|
||||
c := ctx.Client
|
||||
state := lifx.State{}
|
||||
selector := ctx.Flags.String("selector")
|
||||
format := ctx.Flags.String("format")
|
||||
format := ctx.Flags.String("output-format")
|
||||
|
||||
if format == "" && ctx.Config.OutputFormat != "" {
|
||||
format = ctx.Config.OutputFormat
|
||||
|
Reference in New Issue
Block a user