CLIUtils / CLI11

CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.
https://cliutils.github.io/CLI11/book/
Other
3.38k stars 353 forks source link

Invalid subcommand error message is not helpful #1009

Open Garados007 opened 8 months ago

Garados007 commented 8 months ago

I am working on a command line application with a git-like CLI interface and am using your project for this. Unfortunately, the error message is not very helpful when an unknown subcommand has been provided:

$ app unknown-subcommand
ERROR: RequiredError: A subcommand is required
app - app help

I would like to see an error message saying that unknown-subcommand is an unsupported subcommand, and possibly a list of supported subcommands (perhaps filtering for similar ones). Just like git does:

$ git puhs
git: 'puhs' is not a git command. See 'git --help'.

The most similar command is
        push

As far as I can see, this does not seem to be supported in CLI11. Can you add support for this or am I missing something?

phlptp commented 8 months ago

I suppose it is theoretically possible, but it isn't a priority at the moment.