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

Return error when usage was output due to non-runnable command #642

Closed
wants to merge 4 commits into from

Conversation

chriswhelix
Copy link

This allows programs to detect running a non-runnable command as a failure condition and return a non-zero exit code, if they want to. For most existing programs, it will probably result in that behavior by default (assuming they exit non-zero whenever Execute() returns an error).

Usage output in this scenario is also now sent to stderr instead of stdout, which is better for scripting and seems more consistent with surrounding code.

Fixes #582

@n10v
Copy link
Collaborator

n10v commented Jun 8, 2019

@chriswhelix Please resolve merge conflicts

@bruceadowns
Copy link
Contributor

I've encountered the same issue, and agree that if an incorrect subcommand is specified, a non-zero exit code should be returned. This PR has sat for a year and now has conflicts, however I am willing to create a new PR to restart the conversation. @BoGeM, what do you think?

@n10v
Copy link
Collaborator

n10v commented Jul 30, 2019

@bruceadowns it would be great if you reopen the conversation.

@bruceadowns
Copy link
Contributor

@bruceadowns it would be great if you reopen the conversation.

Ok, I will put a PR together.

@bruceadowns
Copy link
Contributor

@bruceadowns it would be great if you reopen the conversation.

Thanks @BoGeM! See new PR #922.

@n10v
Copy link
Collaborator

n10v commented Aug 1, 2019

Close in favour of #922

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.

Invalid command usage result code
3 participants