diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04e55a1a..09df3cd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: jobs: ci: name: CI - needs: [test, test-release, lint, coverage] + needs: [test, test-release, lint] runs-on: ubuntu-latest steps: - name: Done diff --git a/CHANGELOG.md b/CHANGELOG.md index 017ab289..90eb4ab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ TODO: `cargo`, `std` features * `AppSettings::DisableHelpFlags` => `AppSettings::DisableHelpFlag` * `AppSettings::DisableVersion` => `AppSettings::DisableVersionFlag` * `AppSettings::VersionlessSubcommands` => `AppSettings::DisableVersionForSubcommands` +* **Renamed Variants** + * **ErrorKind** + * `ErrorKind::MissingArgumentOrSubcommand` => `ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand` +* **Changed** + * `Arg::env` & `Arg::env_os` does not set `ArgSettings::TakesValue` anymore #### Features @@ -21,6 +26,10 @@ TODO: `cargo`, `std` features * **App** * `App::help_about` * `App::version_about` + * **Arg** + * `Arg::hide_env` +* **Added Settings** + * `ArgSettings::HideEnv` diff --git a/clap_up/Cargo.toml b/clap_up/Cargo.toml index 115d58a8..fa4d49fd 100644 --- a/clap_up/Cargo.toml +++ b/clap_up/Cargo.toml @@ -28,7 +28,7 @@ maintenance = {status = "actively-developed"} bench = false [dependencies] -cargo-up = { version = "=0.0.3" } +cargo-up = { version = "=0.0.4" } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/clap_up/README.md b/clap_up/README.md new file mode 100644 index 00000000..545feb9f --- /dev/null +++ b/clap_up/README.md @@ -0,0 +1,13 @@ +# clap_up + +Automatic code upgrader for [clap](https://docs.rs/clap) (using tool [cargo-up](https://github.com/pksunkara/cargo-up)) + +### Usage + +``` +cargo install cargo-up --features cli --no-default-features +``` + +``` +cargo up dep clap +``` diff --git a/clap_up/src/lib.rs b/clap_up/src/lib.rs index 7a5c25a1..a1f1215b 100644 --- a/clap_up/src/lib.rs +++ b/clap_up/src/lib.rs @@ -5,11 +5,11 @@ pub fn runner() -> Runner { .minimum("2.33.0") .unwrap() .version( - Version::new("3.0.0-beta.1") + Version::new("3.0.0-rc.0") .unwrap() .peers(&["structopt"]) - // .replace("clap::args::SubCommand", "App") // .replace_dep("structopt", "clap", features = ["derive"]) + .rename_structs("clap::args::subcommand", &[["SubCommand", "App"]]) .rename_methods( "structopt::StructOpt", &[ @@ -20,6 +20,33 @@ pub fn runner() -> Runner { ["clap", "into_app"], ], ) + .rename_variants( + "clap::errors::ErrorKind", + &[ + ["HelpDisplayed", "DisplayHelp"], + ["VersionDisplayed", "DisplayVersion"], + [ + "MissingArgumentOrSubcommand", + "DisplayHelpOnMissingArgumentOrSubcommand", + ], + ], + ) + .rename_variants( + "clap::app::settings::AppSettings", + &[ + ["DisableHelpFlags", "DisableHelpFlag"], + ["DisableVersion", "DisableVersionFlag"], + ["VersionlessSubcommands", "DisableVersionForSubcommands"], + ], + ) + .rename_variants( + "clap::args::settings::ArgSettings", + &[ + ["CaseInsensitive", "IgnoreCase"], + ["AllowLeadingHyphen", "AllowHyphenValues"], + ["EmptyValues", "AllowEmptyValues"], + ], + ) .rename_methods( "clap::app::App", &[ @@ -31,6 +58,7 @@ pub fn runner() -> Runner { ["get_matches_safe", "try_get_matches"], ["get_matches_from_safe", "try_get_matches_from"], ["get_matches_from_safe_borrow", "try_get_matches_from_mut"], + ["set_term_width", "term_width"], ], ) .rename_methods( @@ -40,29 +68,6 @@ pub fn runner() -> Runner { ["from_usage", "from"], ["set", "setting"], ["unset", "unset_setting"], - ], - ) - .rename_methods( - "clap::args::subcommand::SubCommand", - &[["with_name", "new"], ["from_yaml", "from"]], - ) - .rename_members("clap::errors::Error", &[["message", "cause"]]) - .hook_method_call_expr(&print_method_calls), - ) - .version( - Version::new("3.0.0-rc.0") - .unwrap() - .rename_variants( - "clap::parse::errors::ErrorKind", - &[ - ["HelpDisplayed", "DisplayHelp"], - ["VersionDisplayed", "DisplayVersion"], - ], - ) - .rename_methods("clap::build::app::App", &[["set_term_width", "term_width"]]) - .rename_methods( - "clap::build::arg::Arg", - &[ ["from_yaml", "from"], ["with_name", "new"], ["required_if", "required_if_eq"], @@ -73,10 +78,17 @@ pub fn runner() -> Runner { ], ) .rename_methods( - "clap::build::arg_group::ArgGroup", + "clap::args::group::ArgGroup", &[["from_yaml", "from"], ["with_name", "new"]], - ), + ) + .rename_methods( + "clap::args::subcommand::SubCommand", + &[["from_yaml", "from"], ["with_name", "new"]], + ) + .rename_members("clap::errors::Error", &[["message", "cause"]]) // TODO: check + .hook_method_call_expr(&print_method_calls), ) + .version(Version::new("3.0.0").unwrap()) } fn print_method_calls(