fix!: Remove Arg::rwquire_value_delimiter
#4026
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In clap v3,
require_value_delimiter
activated an alternative parsemode where
multiple_values
meant "multiple values within a single arg"number_of_values
having no parse impact, only validation impactvalue_names
being delimited valuesFor unbounded
number_of_values
, this is exactly whatvalue_delimiter
provides. The only value is if someone wanted
value_name
to be<file1>,<file2>,...
which can be useful and we might look into addingback in.
Alternatively, this could be used for cases like key-value pairs but
that has issues like not allowing the delimiter in the value which might
be ok in some cases but not others. We already instead document that
people should instead use
ValueParser
for this case.In removing this, we remove points of confusion at how the different
multiple values and delimited value calls interact with each other. I
know I would set
require_value_delimiter(true).multiple_values(true)
when it turns out all I needed was
value_delimiter(',')
.This also reduces the API surface area which makes it easier to discover
what features we do provide.
While this isn't big, this is also yet another small step towards
reducing binary size and compile times.
This is part of #2688