Refactor global flags

This commit is contained in:
2021-03-30 23:54:05 -05:00
parent 05db35cdfe
commit 9c024454f2
9 changed files with 22 additions and 24 deletions

View File

@@ -17,8 +17,6 @@ func NewCmdToggle() Command {
selector := fs.String("selector", defaultSelector, "Set the selector")
fs.StringVar(selector, "s", defaultSelector, "Set the selector")
fs.String("format", defaultOutputFormat, "Set the output format")
return fs
}(),
Use: "[--selector <selector>] [--duration <sec>]",
@@ -32,7 +30,7 @@ func ToggleCmd(ctx Context) (int, error) {
c := ctx.Client
duration := ctx.Flags.Float64("duration")
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