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

Exit non-zero if a unknown subcommand is given #399

Merged
merged 2 commits into from
May 9, 2016

Conversation

jszwedko
Copy link
Contributor

@jszwedko jszwedko commented May 8, 2016

Currently it just prints the help message and exits 0.

We do this by modifying the helpCommand and helpSubcommand cli.Commands
to return an error if they are called with an unknown subcommand. This
propogates up to the app which exits with 3 and prints the error.

Thanks to @danslimmon for the initial approach!

Fixes #276

Currently it just prints the help message and exits 0.

We do this by modifying the helpCommand and helpSubcommand cli.Commands
to return an error if they are called with an unknown subcommand. This
propogates up to the app which exits with 3 and prints the error.

Thanks to @danslimmon for the initial approach!

Fixes #276
@codegangsta codegangsta added the status/claimed someone has claimed this issue label May 8, 2016
@jszwedko
Copy link
Contributor Author

jszwedko commented May 8, 2016

cc/ @meatballhat @danslimmon

@danslimmon
Copy link

@jszwedko Nice. It's a new codebase for me, so I was trying to be as non-invasive as possible with #396. But your way is better.

@jszwedko
Copy link
Contributor Author

jszwedko commented May 8, 2016

I know that feeling, thank you for the feedback!

@meatballhat meatballhat merged commit 63ed8b0 into master May 9, 2016
@meatballhat meatballhat deleted the exit-nonzero-for-unknown-subcommand branch May 9, 2016 05:05
@codegangsta codegangsta removed the status/claimed someone has claimed this issue label May 9, 2016
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.

4 participants