Skip to content

Commit

Permalink
Fix urfavecli.LogFlags
Browse files Browse the repository at this point in the history
Now that urfave/cli#1210 has landed.

Change-Id: If8bffcb2e470e2d7285a4d2c8f1672650f0ec43f
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/363156
Auto-Submit: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
  • Loading branch information
jcgregorio authored and Skia Commit-Bot committed Jan 31, 2021
1 parent b1e935d commit 8825abf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions go/urfavecli/urfavecli.go
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions go/urfavecli/urfavecli_test.go
Expand Up @@ -161,6 +161,7 @@ func TestLogFlags(t *testing.T) {
}

expected := []string{
" --help=false",
" --boolNotPassedIn=false",
" --bool=true",
" --duration=24s",
Expand Down

0 comments on commit 8825abf

Please sign in to comment.