Pass command name to CmdArgs struct
This commit is contained in:
parent
9360df727a
commit
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)
|
||||
|
Loading…
Reference in New Issue
Block a user