Update to clap 4#1253
Conversation
|
Great, thanks for this work @tjquillan. I'll look forward to the final version. |
|
@dandavison If possible I could use your input on an issue I am encountering. It seems as of pub fn get_argument_and_option_names<'a>() -> HashMap<&'a str, &'a str> {
itertools::chain(Self::command().get_opts(), Self::command().get_arguments())
.filter_map(|arg| match (arg.get_id(), arg.get_long()) {
(name, Some(long)) => {
if IGNORED_OPTION_NAMES.contains(name.as_str()) {
None
} else {
Some((name.as_str(), long))
}
}
_ => None,
})
.collect()
}I am very much new to rust so I don't exactly know what a solution to this would look like (it is very possible the answer is obvious to an experienced rust programmer). An alternative I see would be to change the HashMap to |
|
From some looking I wonder if clap-rs/clap#4103 and clap-rs/clap#4223 might be related. Relevant changelog: |
|
Thanks very much for this work @tjquillan. Your commits were included in @nickelc's work #1322 which has merged. |
This updates delta to
clapversion4.0.29. With all the migrations that come along with it. I am leaving this as a draft for now as I still need to make the correct updates to the code. I will list the changes and important parts of4.0.0here as I go. I will try to do each change as a single commit so they can be dropped or changed as needed.Changes:
help,usage,error-contextdefault-features = false, runcargo add clap -F help,usage,error-contextwrap_helpcargo add clap -F wrap_helpunless you want to hard code line wrapsDeriveDisplayOrderas it is now the defaultDeriveDisplayOrderthe default and removed the setting.ValueSourceusing statementclap::{Indices, OsValues, ValueSource, Values}toclap::parser::{Indices, OsValues, ValueSource, Values}#[clap(...)]to#[command(...)]where appropriate#[clap(...)]has been deprecated in favor of#[command(...)]#[clap(...)]to#[arg(...)]where appropriate#[clap(...)]has been deprecated in favor of#[arg(...)]#[structopt(...)]to#[arg(...)]where appropriate#[structopt(...)]has been deprecated in favor of#[arg(...)]value_parserbecause it is now defaultparsetovalue_parser