You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Print the help when --help or -h is unexpectedly encountered.
Most binaries used on Linux support the '--help' argument, this
is a convention specified by the [GNU project][1], as well as in
the [clig][2].
Currently, adding `--help` after a failing command gives an error,
following by an note at the end on how to get the help. Actually
getting the help usually involves pressing the up arrow, removing the
erroneous `--help` at the end, moving the cursor to after `picotool`
to insert `help` and then succesfully printing out the help.
This commit adds a new error type to the parser to distinguish
between parse errors, and errors that can be identified as an attempt
to obtain the help. This help error is raised only if an unexpected
argument called `--help` is encountered, or an unexpected option `-h`.
In the `main.cpp` this specific error is now caught and handled on
appropriately, still relying on the outer catch problematic parse
errors, like using command names that don't exist.
[1]: https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html
[2]: https://clig.dev/#help
0 commit comments