Pass command name to CmdArgs struct

This commit is contained in:
Ryan Cavicchioni 2021-02-07 17:31:19 -06:00
parent 9360df727a
commit d8be978ba8
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
2 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ type CmdArgs struct {
Flags Flags
Client *lifx.Client
Config Config
Name string
}
type Flags struct {

View File

@ -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)