Update changelog and upgrader

This commit is contained in:
Pavan Kumar Sunkara 2020-08-27 22:16:25 +02:00
parent 21f3705e61
commit cfd1826052
4 changed files with 57 additions and 17 deletions

View file

@ -8,18 +8,38 @@ TODO: `cargo`, `std` features
* **Removed**
* `From<&yaml_rust::yaml::Hash>` for `ArgGroup`
* **Error**
* `Error::cause` in favor of `<Error as Display>::to_string`
* **Macros**
* `_clap_count_exprs`
* `_clap_count_exprs!`
* **Renamed Methods**
* `App::set_term_width` => `App::term_width`
* `Arg::from_yaml` => `Arg::from`
* `Arg::with_name` => `Arg::new`
* `ArgGroup::from_yaml` => `ArgGroup::from`
* `ArgGroup::with_name` => `ArgGroup::new`
* **App**
* `App::set_term_width` => `App::term_width`
* **Arg**
* `Arg::from_yaml` => `Arg::from`
* `Arg::with_name` => `Arg::new`
* `Arg::required_if` => `Arg::required_if_eq`
* `Arg::required_ifs` => `Arg::required_if_eq_any`
* `Arg::required_unless` => `Arg::required_unless_present`
* `Arg::required_unless_one` => `Arg::required_unless_eq_any`
* `Arg::required_unless_all` => `Arg::required_unless_eq_all`
* **ArgGroup**
* `ArgGroup::from_yaml` => `ArgGroup::from`
* `ArgGroup::with_name` => `ArgGroup::new`
* **Renamed Variants**
* **ErrorKind**
* `ErrorKind::HelpDisplayed` => `ErrorKind::DisplayHelp`
* `ErrorKind::VersionDisplayed` => `ErrorKind::DisplayVersion`
* **Changed**
* `Error::info` now is of type `Vec<String>` instead of `Option<Vec<String>>`
* `short` in `#[clap()]` now accepts `char` instead of `&str`
* `ArgMatches::subcommand` now returns `Option<(&str, &ArgMatches)>`
#### Features
* Added support for subcommands that are flags (pacman style)
* Added `Indices` that is returned by `ArgMatches::indices_of`
* Added `@global_setting` for app's macro builder
* **Added Methods**
* **Arg**
* `Arg::default_missing_value`
@ -30,14 +50,21 @@ TODO: `cargo`, `std` features
* `Arg::short_aliases`
* `Arg::visible_short_alias`
* `Arg::visible_short_aliases`
* **Added Variants**
* `Arg::value_hint`
* **App**
* `App::subcommand_placeholder`
* `App::before_long_help`
* `App::after_long_help`
* **Added Settings**
* `AppSettings::DisableHelpFlags`
* TODO: List App::get_* methods
#### Enhancements
* `help_heading` defined on `Arg` now has higher priority than `App`
* Limited default text wrapping to 100 when `wrap_help` feature is not enabled
* Multiple bug fixes and error message improvements
* Size and Performance improvements
<a name="v3.0.0-beta.1"></a>
@ -95,11 +122,10 @@ TODO: `cargo`, `std` features
* `Arg::from_usage` => `Arg::from`
* `Arg::set` => `Arg::setting`
* `Arg::unset` => `Arg::unset_setting`
* **Renamed Variants**
* **Renamed Settings**
* `ArgSettings::CaseInsensitive` => `ArgSettings::IgnoreCase`
* `ArgSettings::AllowLeadingHyphen` => `ArgSettings::AllowHyphenValues`
* `ArgSettings::EmptyValues` => `ArgSettings::AllowEmptyValues`
* `ArgSettings::CaseInsensitive` => `ArgSettings::IgnoreCase`
* **Renamed Fields**
* `Error::message` => `Error::cause`
* **Changed**
@ -113,8 +139,8 @@ TODO: `cargo`, `std` features
but `--option [val]...` results in `ArgSettings::MultipleValues` *and* `ArgSettings::MultipleOccurrences`.
Before both resulted in the same thing
* `App` and `Arg` now need only one lifetime
* Allow empty values is no longer the default
* UseValueDelimiter is no longer the default
* Allowing empty values is no longer the default
* `UseValueDelimiter` is no longer the default
* `App::override_usage` no longer implies `\t` which allows multi lined usages
#### Features

View file

@ -113,6 +113,7 @@ targets = ["x86_64-unknown-linux-gnu"]
members = [
"clap_derive",
"clap_generate",
"clap_up",
]
default-members = [
".",

View file

@ -28,7 +28,7 @@ maintenance = {status = "actively-developed"}
bench = false
[dependencies]
cargo-up = { path = "../../../pksunkara/cargo-up/cargo-up" }
cargo-up = { version = "=0.0.3" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View file

@ -1,6 +1,4 @@
use cargo_up::{
ra_hir::Semantics, ra_ide_db::RootDatabase, ra_syntax::ast, Runner, Upgrader, Version,
};
use cargo_up::{ra_ap_syntax::ast, Runner, Semantics, Upgrader, Version};
pub fn runner() -> Runner {
Runner::new()
@ -54,10 +52,25 @@ pub fn runner() -> Runner {
.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"]],
&[
["from_yaml", "from"],
["with_name", "new"],
["required_if", "required_if_eq"],
["required_ifs", "required_if_eq_any"],
["required_unless", "required_unless_present"],
["required_unless_one", "required_unless_eq_any"],
["required_unless_all", "required_unless_eq_all"],
],
)
.rename_methods(
"clap::build::arg_group::ArgGroup",
@ -69,7 +82,7 @@ pub fn runner() -> Runner {
fn print_method_calls(
upgrader: &mut Upgrader,
method_call_expr: &ast::MethodCallExpr,
semantics: &Semantics<RootDatabase>,
semantics: &Semantics,
) {
if let Some(name_ref) = method_call_expr.name_ref() {
// println!("method: {}", name_ref.text());