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