From d8be978ba8dc8b65d2f08213b5366cc94996ba8d Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sun, 7 Feb 2021 17:31:19 -0600 Subject: [PATCH] Pass command name to CmdArgs struct --- cmd/command.go | 1 + cmd/main.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/command.go b/cmd/command.go index 3dd376d..80c9473 100644 --- a/cmd/command.go +++ b/cmd/command.go @@ -23,6 +23,7 @@ type CmdArgs struct { Flags Flags Client *lifx.Client Config Config + Name string } type Flags struct { diff --git a/cmd/main.go b/cmd/main.go index ad497e4..d978c3a 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -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)