-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Emit non-zero exit code upon non-runnable subcommand #922
Conversation
|
* i.e. * go get golang.org/x/lint/golint * go list ./... | xargs golint
* i.e. * go get golang.org/x/tools/cmd/goimports * goimports -w *.go * goimports -w cobra/
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.
This PR looks really good, but please fix things below
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.
A lot better now :)
There is a change in Cobra which causes the help message to be printed to stderr instead of stdout. See spf13/cobra#922 In preparation for a future upgrade to a new version of Cobra, this commit allows the tests to support both cases. Signed-off-by: Marc Khouzam <[email protected]>
There is a change in Cobra which causes the help message to be printed to stderr instead of stdout. See spf13/cobra#922 In preparation for a future upgrade to a new version of Cobra, this commit allows the tests to support both cases. Signed-off-by: Marc Khouzam <[email protected]>
Issue Reference: spf13#1056 when a command was not runnable. This caused all commands w/o a run function set to error w/ that message and a status code of 1. This change reverts the addition of that new error. Similar functionality can be accomplished by leveraging RunE.
Issue Reference: spf13#1056 spf13#922 introduced a new error type that emitted when a command was not runnable. This caused all commands w/o a run function set to error w/ that message and a status code of 1. This change reverts the addition of that new error. Similar functionality can be accomplished by leveraging RunE.
Issue Reference: #1056 #922 introduced a new error type that emitted when a command was not runnable. This caused all commands w/o a run function set to error w/ that message and a status code of 1. This change reverts the addition of that new error. Similar functionality can be accomplished by leveraging RunE.
Issue Reference: spf13/cobra#1056 spf13/cobra#922 introduced a new error type that emitted when a command was not runnable. This caused all commands w/o a run function set to error w/ that message and a status code of 1. This change reverts the addition of that new error. Similar functionality can be accomplished by leveraging RunE.
Issue Reference: spf13/cobra#1056 spf13/cobra#922 introduced a new error type that emitted when a command was not runnable. This caused all commands w/o a run function set to error w/ that message and a status code of 1. This change reverts the addition of that new error. Similar functionality can be accomplished by leveraging RunE.
This is a refresh of PR #642 and fixes issue #582.