Skip to content
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

Merged
merged 6 commits into from Aug 1, 2019
Merged

Emit non-zero exit code upon non-runnable subcommand #922

merged 6 commits into from Aug 1, 2019

Conversation

bruceadowns
Copy link
Contributor

@bruceadowns bruceadowns commented Jul 30, 2019

This is a refresh of PR #642 and fixes issue #582.

@CLAassistant
Copy link

CLAassistant commented Jul 30, 2019

CLA assistant check
All committers have signed the CLA.

@bruceadowns
Copy link
Contributor Author

bruceadowns commented Jul 30, 2019

I tried to sign the cla, but cla-assistant.io fails. I re-signed this morning, and it worked.

bruceadowns added 2 commits Jul 30, 2019
* 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/
Copy link
Collaborator

@bogem bogem left a comment

This PR looks really good, but please fix things below

args.go Outdated Show resolved Hide resolved
cobra/cmd/project.go Outdated Show resolved Hide resolved
cobra/cmd/project.go Outdated Show resolved Hide resolved
cobra/cmd/project.go Outdated Show resolved Hide resolved
cobra/main.go Outdated Show resolved Hide resolved
cobra/tpl/main.go Outdated Show resolved Hide resolved
cobra/tpl/main.go Outdated Show resolved Hide resolved
cobra/tpl/main.go Outdated Show resolved Hide resolved
command.go Outdated Show resolved Hide resolved
command.go Outdated Show resolved Hide resolved
bogem
bogem approved these changes Aug 1, 2019
Copy link
Collaborator

@bogem bogem left a comment

A lot better now :)

@bogem bogem merged commit 993cc53 into spf13:master Aug 1, 2019
5 checks passed
umarcor added a commit to umarcor/cobra that referenced this pull request Sep 5, 2019
marckhouzam added a commit to VilledeMontreal/acceptance-testing that referenced this pull request Dec 8, 2019
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 <marc.khouzam@montreal.ca>
jdolitsky pushed a commit to helm/acceptance-testing that referenced this pull request Dec 9, 2019
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 <marc.khouzam@montreal.ca>
@jharshman jharshman mentioned this pull request Mar 26, 2020
jharshman added a commit to jharshman/cobra that referenced this pull request Mar 26, 2020
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.
jharshman added a commit to jharshman/cobra that referenced this pull request Mar 26, 2020
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.
jharshman added a commit that referenced this pull request Mar 27, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants