-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print usage instead of panic for no arguments (#24)
* Print usage instead of panic for no arguments Previously, if no arguments were passed to the root command, a panic was triggered which in turn bypassed the error handling strategy. Also the provided message was not really helpful to the user. With this commit the usage is printed instead. Additionally, an error is returned which is correctly handled by the error handling strategy. * Revert to old behavior * Print usage if no subcommand was given When no subcommand is passed to the application, only a short error text was printed to the console. Now the usage text is printed as well. * Cleanup * Add test for call without sub commands * Remove explicit error discarding
- Loading branch information
Jan
authored
Sep 26, 2020
1 parent
769c8c8
commit 8cff9ee
Showing
3 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters