Skip to content

Suggest removing -- if specified, but unnecessary #3604

Description

@nazar-pc

Please complete the following tasks

Clap Version

3.1.6

Describe your use case

Users are sometimes confused by help message generated by Clap in case -- was used where it was not expected:

$ ./app -- --dev --tmp
error: Found argument '--dev' which wasn't expected, or isn't valid in this context

        If you tried to supply `--dev` as a value rather than a flag, use `-- --dev`

Describe the solution you'd like

In this particular case the suggestion should be to remove -- instead of adding one more, like this:

$ ./app -- --dev --tmp
error: Found value '--dev' which wasn't expected, or isn't valid in this context

        There is an flag with the same name, try to remove `--`

Alternatives, if applicable

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-helpArea: documentation, including docs.rs, readme, examples, etc...C-bugCategory: bugE-easyCall for participation: Experience needed to fix: Easy / not much

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions