3 ms·
> As in the case of podman above, if you know your user is asking for help, show them the damn help. Since (as other comments say) you can never know for sure
by lou1306 5y ago
> As in the case of podman above, if you know your user is asking for help, show them the damn help.
Since (as other comments say) you can never know for sure that the user is asking for helo, the only sane way to actually implement this is to show the "usage" message on every incorrect invocation of the command.
This has two drawbacks, however:
* It makes the output of an incorrect invocation much longer. Personally, I prefer the 2-line output approach (1 line for the error, 1 explaining how to ask for help)
* You still need to have an explicit help command, because I sure as hell don't want to craft an intentionally incorrect invocation every time I want to see the usage message.
My 2 cents: just use "--help/-h" or a "help" subcommand. They are by large the most popular ways to check out usage, no need to be creative here.