Skip to content
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

fix!: Remove Arg::rwquire_value_delimiter #4026

Merged
merged 1 commit into from Aug 4, 2022
Merged

Commits on Aug 4, 2022

  1. fix!: Remove Arg::rwquire_value_delimiter

    In clap v3, `require_value_delimiter` activated an alternative parse
    mode where
    - `multiple_values` meant "multiple values within a single arg"
    - `number_of_values` having no parse impact, only validation impact
    - `value_names` being delimited values
    
    For unbounded `number_of_values`, this is exactly what `value_delimiter`
    provides.  The only value is if someone wanted `value_name` to be
    `<file1>,<file2>,...` which can be useful and we might look into adding
    back 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.
    epage committed Aug 4, 2022
    Copy the full SHA
    85ad452 View commit details
    Browse the repository at this point in the history