Compare commits
2 Commits
9360df727a
...
8c6567bc8a
Author | SHA1 | Date | |
---|---|---|---|
8c6567bc8a | |||
d8be978ba8 |
@ -23,6 +23,7 @@ type CmdArgs struct {
|
||||
Flags Flags
|
||||
Client *lifx.Client
|
||||
Config Config
|
||||
Name string
|
||||
}
|
||||
|
||||
type Flags struct {
|
||||
|
@ -237,6 +237,7 @@ func Main(args []string) (int, error) {
|
||||
fs.Parse(args[2:])
|
||||
|
||||
cmdArgs.Flags = Flags{FlagSet: fs}
|
||||
cmdArgs.Name = command
|
||||
exitCode, err := cmd.Func(cmdArgs)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("fatal: %s", err)
|
||||
|
@ -2,7 +2,6 @@ package lumecmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
lifx "git.kill0.net/chill9/lume"
|
||||
)
|
||||
@ -23,7 +22,7 @@ func SetColorCmd(args CmdArgs) (int, error) {
|
||||
name := args.Flags.String("name")
|
||||
|
||||
if (hueFlag == "" || saturationFlag == "") && rgbFlag == "" && name == "" {
|
||||
printCmdHelp(os.Args[1])
|
||||
printCmdHelp(args.Name)
|
||||
return ExitFailure, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user