Skip to content

Allow an array of delimiters in value_delimiter #6079

@Andrew15-5

Description

@Andrew15-5

Please complete the following tasks

Clap Version

master

Describe your use case

As I found out, cargo use a custom parsing for, e.g., --features by splitting each argument with comma and whitespace and then flattening an array of the split stuff (if flag was used several times).

#6076 (reply in thread)

That is despite using clap, which does have value_delimiter. However, you can only split using a single char (or even string?) right now. In Dioxus, there are several places where splitting works and doesn't work automatically. Some of this is probably due to downstream further parsing, like with --features that is sent to cargo through Command.

Describe the solution you'd like

I want to be able to write value_delimiter = [' ', ','] and get all the split arguments to be concatenated into a single Vec<String>, automatically being flattened. This provides great flexibility in how you can pass arguments to the same flag.

Alternatives, if applicable

The only alternative would be this.

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