mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 23:02:31 +00:00
Merge #2208
2208: Updated changelog and more dep upgrade logic r=pksunkara a=pksunkara Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
This commit is contained in:
commit
602c79fecd
5 changed files with 63 additions and 29 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -8,7 +8,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
name: CI
|
name: CI
|
||||||
needs: [test, test-release, lint, coverage]
|
needs: [test, test-release, lint]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Done
|
- name: Done
|
||||||
|
|
|
@ -14,6 +14,11 @@ TODO: `cargo`, `std` features
|
||||||
* `AppSettings::DisableHelpFlags` => `AppSettings::DisableHelpFlag`
|
* `AppSettings::DisableHelpFlags` => `AppSettings::DisableHelpFlag`
|
||||||
* `AppSettings::DisableVersion` => `AppSettings::DisableVersionFlag`
|
* `AppSettings::DisableVersion` => `AppSettings::DisableVersionFlag`
|
||||||
* `AppSettings::VersionlessSubcommands` => `AppSettings::DisableVersionForSubcommands`
|
* `AppSettings::VersionlessSubcommands` => `AppSettings::DisableVersionForSubcommands`
|
||||||
|
* **Renamed Variants**
|
||||||
|
* **ErrorKind**
|
||||||
|
* `ErrorKind::MissingArgumentOrSubcommand` => `ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand`
|
||||||
|
* **Changed**
|
||||||
|
* `Arg::env` & `Arg::env_os` does not set `ArgSettings::TakesValue` anymore
|
||||||
|
|
||||||
#### Features
|
#### Features
|
||||||
|
|
||||||
|
@ -21,6 +26,10 @@ TODO: `cargo`, `std` features
|
||||||
* **App**
|
* **App**
|
||||||
* `App::help_about`
|
* `App::help_about`
|
||||||
* `App::version_about`
|
* `App::version_about`
|
||||||
|
* **Arg**
|
||||||
|
* `Arg::hide_env`
|
||||||
|
* **Added Settings**
|
||||||
|
* `ArgSettings::HideEnv`
|
||||||
|
|
||||||
|
|
||||||
<a name="v3.0.0-beta.2"></a>
|
<a name="v3.0.0-beta.2"></a>
|
||||||
|
|
|
@ -28,7 +28,7 @@ maintenance = {status = "actively-developed"}
|
||||||
bench = false
|
bench = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cargo-up = { version = "=0.0.3" }
|
cargo-up = { version = "=0.0.4" }
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
|
13
clap_up/README.md
Normal file
13
clap_up/README.md
Normal file
|
@ -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
|
||||||
|
```
|
|
@ -5,11 +5,11 @@ pub fn runner() -> Runner {
|
||||||
.minimum("2.33.0")
|
.minimum("2.33.0")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.version(
|
.version(
|
||||||
Version::new("3.0.0-beta.1")
|
Version::new("3.0.0-rc.0")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.peers(&["structopt"])
|
.peers(&["structopt"])
|
||||||
// .replace("clap::args::SubCommand", "App")
|
|
||||||
// .replace_dep("structopt", "clap", features = ["derive"])
|
// .replace_dep("structopt", "clap", features = ["derive"])
|
||||||
|
.rename_structs("clap::args::subcommand", &[["SubCommand", "App"]])
|
||||||
.rename_methods(
|
.rename_methods(
|
||||||
"structopt::StructOpt",
|
"structopt::StructOpt",
|
||||||
&[
|
&[
|
||||||
|
@ -20,6 +20,33 @@ pub fn runner() -> Runner {
|
||||||
["clap", "into_app"],
|
["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(
|
.rename_methods(
|
||||||
"clap::app::App",
|
"clap::app::App",
|
||||||
&[
|
&[
|
||||||
|
@ -31,6 +58,7 @@ pub fn runner() -> Runner {
|
||||||
["get_matches_safe", "try_get_matches"],
|
["get_matches_safe", "try_get_matches"],
|
||||||
["get_matches_from_safe", "try_get_matches_from"],
|
["get_matches_from_safe", "try_get_matches_from"],
|
||||||
["get_matches_from_safe_borrow", "try_get_matches_from_mut"],
|
["get_matches_from_safe_borrow", "try_get_matches_from_mut"],
|
||||||
|
["set_term_width", "term_width"],
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
.rename_methods(
|
.rename_methods(
|
||||||
|
@ -40,29 +68,6 @@ pub fn runner() -> Runner {
|
||||||
["from_usage", "from"],
|
["from_usage", "from"],
|
||||||
["set", "setting"],
|
["set", "setting"],
|
||||||
["unset", "unset_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"],
|
["from_yaml", "from"],
|
||||||
["with_name", "new"],
|
["with_name", "new"],
|
||||||
["required_if", "required_if_eq"],
|
["required_if", "required_if_eq"],
|
||||||
|
@ -73,10 +78,17 @@ pub fn runner() -> Runner {
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
.rename_methods(
|
.rename_methods(
|
||||||
"clap::build::arg_group::ArgGroup",
|
"clap::args::group::ArgGroup",
|
||||||
&[["from_yaml", "from"], ["with_name", "new"]],
|
&[["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(
|
fn print_method_calls(
|
||||||
|
|
Loading…
Reference in a new issue