coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

Move to clap 3.2

Open sylvestre opened this issue 2 years ago • 2 comments

We are using a bunch of things which are now deprecated.

https://epage.github.io/blog/2022/06/clap-32-last-call-before-40/

For example:

warning: use of deprecated associated function `clap::ArgMatches::value_of`: Replaced with `ArgMatches::get_one()`
   --> src/bin/coreutils.rs:156:25
    |
156 |     let shell = matches.value_of("shell").unwrap();
warning: use of deprecated associated function `clap::Arg::<'help>::possible_values`: Replaced with `Arg::value_parser(PossibleValuesParser::new(...)).takes_value(true)`
   --> src/bin/coreutils.rs:150:18
    |
150 |                 .possible_values(Shell::possible_values())
warning: use of deprecated associated function `clap::ArgMatches::values_of`: Replaced with `ArgMatches::get_many()`
   --> src/uu/stdbuf/src/stdbuf.rs:167:38
    |
167 |     let mut command_values = matches.values_of::<&str>(options::COMMAND).unwrap();

See https://github.com/uutils/coreutils/pull/3631

sylvestre avatar Jun 14 '22 08:06 sylvestre

I'm very exited about this, but it's gonna be a very big refactor. Sadly, we can't really do this piece by piece, because the multicall binary will break.

tertsdiepraam avatar Jun 14 '22 08:06 tertsdiepraam

It might be worth noting that https://github.com/clap-rs/clap/pull/3830 turns off the deprecations by default for now; fixing the deprecations may still need to be addressed when 4.0 is released and dependabot makes a PR for clap 3.3 (where the deprecation feature may be turned on by default), but for now the warnings won't show up when building/running, and an upgrade to clap 3.2 brings a stabilized Command::multicall to play around with.

ndd7xv avatar Jul 09 '22 19:07 ndd7xv

looks like this can now be closed

tshepang avatar Sep 10 '22 05:09 tshepang