diff --git a/go/urfavecli/urfavecli.go b/go/urfavecli/urfavecli.go index 47c839794af..b7a17417530 100644 --- a/go/urfavecli/urfavecli.go +++ b/go/urfavecli/urfavecli.go @@ -20,11 +20,14 @@ import ( // }, // }, func LogFlags(cliContext *cli.Context) { + for _, flag := range cliContext.App.Flags { + name := flag.Names()[0] + sklog.Infof("App Flags: --%s=%v", name, cliContext.Value(name)) + } for _, flag := range cliContext.Command.Flags { name := flag.Names()[0] - sklog.Infof("Flags: --%s=%v", name, cliContext.Value(name)) + sklog.Infof("Command Flags: --%s=%v", name, cliContext.Value(name)) } - } // MarkdownDocTemplate is a common template used to format commands as Markdown. diff --git a/go/urfavecli/urfavecli_test.go b/go/urfavecli/urfavecli_test.go index d777e55a03e..3b8f6185c48 100644 --- a/go/urfavecli/urfavecli_test.go +++ b/go/urfavecli/urfavecli_test.go @@ -161,6 +161,7 @@ func TestLogFlags(t *testing.T) { } expected := []string{ + " --help=false", " --boolNotPassedIn=false", " --bool=true", " --duration=24s",