-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#[arg(value_delimiter = ':')]
Delimiter isnt displayed in the help message.
#5392
Comments
For #4812, we are looking at including it within the example usage. I'd be interested in exploring ways of doing that here as well. |
#[arg(value_delimiter = ':')]
Delimiter isnt displayed in the help message.
Closes clap-rs#5392 and clap-rs#4812, related to clap-rs#1052
Closes clap-rs#5392 and clap-rs#4812, related to clap-rs#1052
Closes clap-rs#5392 and clap-rs#4812, related to clap-rs#1052
Closes clap-rs#5392 and clap-rs#4812, related to clap-rs#1052
Placing it in the usage can be similar to what was done for #1052, but then that's only visible when there's more than one value name. I'm proposing to also add it in the help message of the option/argument |
Not quite as that is conflating a couple of features which I realized in seeing #5817 In that PR, arg!(-f --fake <s> "some help")
.required(true)
.required(true)
.value_names(["some", "val"])
.action(ArgAction::Set)
.value_delimiter(':'),
) gets rendered as
Seeing that is reminding of the weird interplay of
So We have the idea of clap/clap_builder/src/builder/arg.rs Lines 4664 to 4671 in 2920fb0
If we used something like that, we could get
or
|
Currently we do this for
Seeing two of those rendered together, we get
Overall, I'm not thrilled with these and don't feel like they compose well together, and worry about extending them more. Also, if we can find ways to include them in the usage, it becomes more natural (like I want to do with possible values). btw a good test case for one, the other, or both options is to see what Cargo's output would look like with changing this. |
From what I gathered, there used to be an option to require the delimiter, but without it we're left with allowing both the delimiter and the space separated values. I didn't think that an issue. Your idea with the
Although it gets a bit hard to read...
About the |
Any particular cargo command I can try to see interesting result? |
That setting was because of a weird interaction between features and became redundant. Just setting a value delimiter makes it so you only use the value delimiter. You have to explicitly opt-in to
If you have both |
Hmm, the only delimited value I'm remember is |
Please complete the following tasks
Clap Version
4.5.2
Describe your use case
Most of the arguments are already documented by clap, I didnt even have to do anything (nice). However the delimiter doesnt show up in the help message.
Describe the solution you'd like
The delimiter should be shown like this:
Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: