From: Ian Jackson Date: Thu, 15 Jun 2023 19:09:15 +0000 (+0100) Subject: clap: Use ArgAction::Append X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=3e8235469d4c58d4bb4ba2ed22431c192ac673f4;p=hippotat.git clap: Use ArgAction::Append Gets rid of this 3 to 4 deprecation warning. The warning's suggestion to use "multiple_occurrences" seems wrong since that is also deprecated ?! It links to Arg::action, and emprically this construction DTRT. warning: use of deprecated method `clap::Arg::<'help>::multiple`: Split into `Arg::multiple_occurrences` (most likely what you want) and `Arg::multiple_values` --> src/config.rs:89:16 | 89 | #[clap(long, multiple=true, number_of_values=1)] | ^^^^^^^^ | = note: `#[warn(deprecated)]` on by default Signed-off-by: Ian Jackson --- diff --git a/src/config.rs b/src/config.rs index 538bce2..728a04b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -86,7 +86,7 @@ pub struct Opts { pub config: PathBuf, /// Additional config files or dirs, which can override the others - #[clap(long, multiple=true, number_of_values=1)] + #[clap(long, action=clap::ArgAction::Append)] pub extra_config: Vec, }