add short flags
This commit is contained in:
parent
917053f39c
commit
e9771c4ca7
@ -14,7 +14,8 @@ var (
|
||||
|
||||
func init() {
|
||||
fs := flag.NewFlagSet("toggle", flag.ExitOnError)
|
||||
fs.String("selector", "all", "Set the selector")
|
||||
selector := fs.String("selector", "all", "Set the selector")
|
||||
fs.StringVar(selector, "s", "all", "Set the selector")
|
||||
|
||||
RegisterCommand("ls", Command{
|
||||
Func: LsCmd,
|
||||
|
@ -9,8 +9,10 @@ import (
|
||||
|
||||
func init() {
|
||||
fs := flag.NewFlagSet("toggle", flag.ExitOnError)
|
||||
fs.Float64("duration", 1.0, "Set the duration")
|
||||
fs.String("selector", "all", "Set the selector")
|
||||
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{
|
||||
Func: ToggleCmd,
|
||||
|
Loading…
Reference in New Issue
Block a user