-
Notifications
You must be signed in to change notification settings - Fork 71
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
Show help if no subcommands provided #60
Comments
Please, could you clarify? If there are subcommands you would like to get help message for each of these subcommands? If we have |
Not exactly, I want to get same effect like "-h" option when no any option is given. I.e.
should act like
|
This is replated to subcommand with only possible subcommand, without arguments and options |
But if |
Generally speaking yes, but on the other hand, there isn't any possibility to show help for such "umbrella" subcommand, because |
this would easily be achieved by just making |
Just stumbled upon the same issue. Would be nice if there would be an option to enable this behavior or the option to call val arguments = "-h"
.takeIf { args.isEmpty() }
?.let { args + it }
?: args
parser.parse(arguments) |
Another vote for making printError or makeUsage public. I'd like to be able to output an error message and the usage statement if the app is just executed with no subcommands provided. |
Oh, nice idea! I tried it but unfortunately even this workaround isn't great since it will cause the app to return exit code 0 as if it was invoked with -h on purpose rather than returning an error. |
It would be nice to have an option to show the help of the subcommand if no options and no subcommands are specified.
The text was updated successfully, but these errors were encountered: