Skip to content

Handling typos in commands and subcommands #1149

Open
@Hind-M

Description

@Hind-M

Hey there!
We are using CLI11 in our project, and we were wondering if there is anything that we can use to handle typos in set commands/subcommands?
For now if we run for example:

mamba instal test

The printed error would be:

The following arguments were not expected: test instal
Run with --help for more information.

Which is ok as we can guess that instal is not the right command, but that gets more confusing if multiple arguments are used as the error is not really explicit and does not point to the exact offending argument.

For example:

mamba reqoquery whoneeds _openmp_mutex

outputs:

The following arguments were not expected: _openmp_mutex whoneeds reqoquery
Run with --help for more information.

Furthermore, the arguments in the output are written in the reverse order of the command.

cf. mamba-org/mamba#3856

Maybe the error with multiple arguments could be more explicit, or we could use some kind of validation methods if available?
Additionally, if suggestions are supported in CLI11 that would be awesome!

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions