New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Remove version flag from commands with subcommands #1153
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, this change makes sense to me.
Since this is targeting #1073, would you mind adding a test case demonstrating that it is now possible to add a -v
flag to sub-commands?
command_test.go
Outdated
HideHelp: true, | ||
Action: func(c *Context) error { | ||
if len(c.App.VisibleFlags()) != 0 { | ||
t.Fatalf("unexpected flag on command") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Since there's no formatting here, t.Fatal
is more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Sure, added such one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested it, and apparently the --version
flag does nothing on commands and subcommands? So this PR LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What type of PR is this?
What this PR does / why we need it:
This PR removes unexpected version flag on commands with subcommands.
Which issue(s) this PR fixes:
Fixes #1073
Testing
test added
Release Notes