Skip to content

Ignore empty arguments split by value_delimiter #6080

@Andrew15-5

Description

@Andrew15-5

Please complete the following tasks

Clap Version

master

Describe your use case

Additionally to #6079, the cargo --features parser eliminates empty arguments that were produced by splitting, therefore not causing an error for, e.g., --features a,b,. If this can be done declaratively with clap (and #6079), then cargo can remove the custom parser and use a built-in solution. This also can be used by any other CLI, including dx, to offer a very flexible and friendly way to pass multiple arguments to the same flag.

Describe the solution you'd like

Something like ignore_empty_delimited_values(true). It probably should only apply to Vec<_> flags. Not sure how useful it would be for Option<_> ones (--flag '').

Alternatives, if applicable

Using custom parser, like cargo does.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parsingArea: Parser's logic and needs it changed somehow.C-enhancementCategory: Raise on the bar on expectationsS-waiting-on-decisionStatus: Waiting on a go/no-go before implementing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions