2904: Prepare release 3.0.0-beta.5 r=pksunkara a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
This commit is contained in:
bors[bot] 2021-10-17 16:10:55 +00:00 committed by GitHub
commit 33d86effc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 104 additions and 36 deletions

View file

@ -91,7 +91,7 @@ jobs:
if: matrix.features == 'none'
with:
command: test
args: --target ${{ matrix.target }} --no-default-features --features "std cargo" -p clap:3.0.0-beta.4
args: --target ${{ matrix.target }} --no-default-features --features "std cargo" -p clap:3.0.0-beta.5
- name: Test all features
uses: actions-rs/cargo@v1
if: matrix.features == 'all'
@ -133,7 +133,7 @@ jobs:
if: matrix.features == 'none'
with:
command: test
args: --no-default-features --features "std cargo" -p clap:3.0.0-beta.4
args: --no-default-features --features "std cargo" -p clap:3.0.0-beta.5
- name: Test all features
uses: actions-rs/cargo@v1
if: matrix.features == 'all'

View file

@ -6,16 +6,84 @@ TODO: `YamlLoader`
<a name="v3.0.0-rc.0"></a>
## v3.0.0-rc.0
<a name="v3.0.0-beta.5"></a>
## v3.0.0-beta.5 (2021-10-18)
#### BREAKING CHANGES
* **Renamed Features**
* `unicode_help` to `unicode` to encompass more functionality
* **Gated Features**
* **Gated behind features**
* `App::replace` is now gated behind `unstable-replace`
* **Removed `derive` requirement**
* `clap::ArgEnum`
* `clap::Args`
* `clap::FromArgMatches`
* `clap::IntoApp`
* `clap::Subcommand`
* **Renamed Traits**
* `clap::Clap` => `clap::Parser`
* **Renamed Methods**
* `App::generate_usage` => `App::render_usage`
* **Removed Settings**
* `AppSettings::DisableVersionForSubcommands`
* `AppSettings::ColoredHelp`: we are now relying solely on the `color` feature flag and `AppSettings::Color(Auto|Always|Never)`
* `AppSettings::DisableVersionForSubcommands` is now default behaviour
* `AppSettings::ColoredHelp`: we are now relying solely on the `color` feature flag and `App::color` method
* `AppSettings::StrictUtf8` is now default behaviour
* `AppSettings::AllowInvalidUtf8` in favor of `ArgSettings::AllowInvalidUtf8`
* `AppSettings::UnifiedHelpMessage` is now default behaviour
* `AppSettings::ColorAlways` in favor of `App::color`
* `AppSettings::ColorNever` in favor of `App::color`
* `AppSettings::ColorAuto` in favor of `App::color`
* **Removed methods**
* **App**
* `App::get_flags`
* `App::get_positionals_with_no_heading`
* `App::get_flags_with_no_heading`
* `App::get_opts_with_no_heading`
* `App::stop_custom_headings` in favor of `App:help_heading(None)`
* **Error**
* `Error::with_description` in favor of `App::error`
* **ArgEnum**
* `ArgEnum::as_arg` in favor of `ArgEnum::to_arg_value`
* **clap_generate::Generator**
* `Generator::all_subcommands`
* `Generator::find_subcommand_with_path`
* `Generator::subcommands`
* `Generator::shorts_and_visible_aliases`
* `Generator::longs_and_visible_aliases`
* `Generator::flags`
* **Removed**
* `ArgEnum::VARIANTS` in favor of `ArgEnum::value_variants`
* **Deprecated**
* `clap::clap_app!` in favor of other builders
* **Changed**
* `App::get_possible_values` returns `Option<&[ArgValue]>` now
* `RegexRef` is now an enum also allowing `RegexSet` to be used
* `clap_generate::Generator::file_name` and `clap_generate::Generator::generate` now take `&self`
* `clap_generate::generate` and `clap_generate::generate_to` now takes `Generator` as first argument
#### Features
* **Added**
* `clap::ArgValue` to denote information about possible values for args
* `clap::ColorChoice` to specify color setting for the app
* **Added Settings**
* `AppSettings::AllowInvalidUtf8ForExternalSubcommands`
* `AppSettings::Multicall` behind `unstable-multicall` feature
* `ArgSettings::AllowInvalidUtf8`
* **Added Methods**
* **ArgEnum**
* `ArgEnum::value_variants`
* `ArgEnum::to_arg_value`
* **App**
* `App::color`
* `App::error`
* `App::get_long_about`
* `App::get_help_heading`
* **Arg**
* `Arg::is_positional`
* Allow positionals to occur multiple times
<a name="v3.0.0-beta.4"></a>
## v3.0.0-beta.4 (2021-08-14)
@ -34,7 +102,6 @@ Added `unicode_help`, `env` features.
* `Arg::hide_env_values`
* **ArgSettings**
* `ArgSettings::HideEnvValues`
* **Removed Methods**
* **Arg**
* `Arg::settings` in favor of `Arg::setting(Setting1 | Setting2)`
@ -42,17 +109,11 @@ Added `unicode_help`, `env` features.
* **Renamed Settings**
* `AppSettings::DisableHelpFlags` => `AppSettings::DisableHelpFlag`
* `AppSettings::DisableVersion` => `AppSettings::DisableVersionFlag`
* `AppSettings::VersionlessSubcommands` => `AppSettings::DisableVersionForSubcommands`
* `AppSettings::VersionlessSubcommands` => `AppSettings::DisableVersionForSubcommands` (changed again 3.0.0-beta.5)
* **Renamed Variants**
* **ErrorKind**
* `ErrorKind::MissingArgumentOrSubcommand` => `ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand`
* **Changed**
* `AppSettings::StrictUtf8` is now default and it and `AppSettings::AllowInvalidUtf8` are replaced by
* `AppSettings::AllowInvalidUtf8ForExternalSubcommands`
* This only applies to the subcommand args. Before we paniced if the
subcommand itself was invalid but now we will report an error up to the
user.
* `ArgSettings::AllowInvalidUtf8`
* Allowing empty values is the default again with `ArgSettings::AllowEmptyValues` changing to
`ArgSettings::ForbidEmptyValues`
* `AppSettings::GlobalVersion` renamed to `AppSettings::PropagateVersion` and it is not applied
@ -78,6 +139,7 @@ Added `unicode_help`, `env` features.
* **Added**
* `clap_generate::Shell`
* `clap::Args` behind `derive` feature
* **Added Methods**
* **App**
* `App::license`

View file

@ -1,6 +1,6 @@
[package]
name = "clap"
version = "3.0.0-beta.4"
version = "3.0.0-beta.5"
edition = "2018"
authors = [
"Kevin K. <kbknapp@gmail.com>",
@ -60,7 +60,7 @@ name = "06_rustup"
path = "benches/06_rustup.rs"
[dependencies]
clap_derive = { path = "./clap_derive", version = "=3.0.0-beta.4", optional = true }
clap_derive = { path = "./clap_derive", version = "=3.0.0-beta.5", optional = true }
bitflags = "1.2"
textwrap = { version = "0.14.0", default-features = false, features = [] }
unicase = { version = "2.6", optional = true }

View file

@ -17,7 +17,7 @@ It is a simple-to-use, efficient, and full-featured library for parsing command
* [Questions & Discussions](https://github.com/clap-rs/clap/discussions)
* [Website](https://clap.rs/)
We are currently hard at work trying to release `3.0`. We have a `3.0.0-beta.4` prerelease out but we do not give any guarantees that its API is stable. We do not have a changelog yet which will be written down after we are sure about the API stability. We recommend users to not update to the prerelease version yet and to wait for the official `3.0`.
We are currently hard at work trying to release `3.0`. We have a `3.0.0-beta.5` prerelease out but we do not give any guarantees that its API is stable. We do not have a changelog yet which will be written down after we are sure about the API stability. We recommend users to not update to the prerelease version yet and to wait for the official `3.0`.
> If you're looking for the readme & examples for `clap v2.33` - find it on [github](https://github.com/clap-rs/clap/tree/v2.33.0), [crates.io](https://crates.io/crates/clap/2.33.0), [docs.rs](https://docs.rs/clap/2.33.0/clap/).
@ -28,8 +28,7 @@ We are currently hard at work trying to release `3.0`. We have a `3.0.0-beta.4`
1. [Using Derive Macros](#using-derive-macros)
2. [Using Builder Pattern](#using-builder-pattern)
3. [Using YAML](#using-yaml)
4. [Using Macros](#using-macros)
5. [Running it](#running-it)
4. [Running it](#running-it)
5. [Try it!](#try-it)
1. [Pre-Built Test](#pre-built-test)
2. [Build Your Own Binary](#build-your-own-binary)
@ -126,7 +125,7 @@ Add `clap` to your `Cargo.toml`
```toml
[dependencies]
clap = "3.0.0-beta.4"
clap = "3.0.0-beta.5"
```
#### Using Derive Macros
@ -350,7 +349,7 @@ Simply add the `yaml` feature flag to your `Cargo.toml`.
```toml
[dependencies]
clap = { version = "3.0.0-beta.4", features = ["yaml"] }
clap = { version = "3.0.0-beta.5", features = ["yaml"] }
```
Finally we create our `main.rs` file just like we would have with the previous two examples:
@ -426,7 +425,7 @@ For full usage, add `clap` as a dependency in your `Cargo.toml` to use from crat
```toml
[dependencies]
clap = "3.0.0-beta.4"
clap = "3.0.0-beta.5"
```
Define a list of valid arguments for your program (see the [documentation][docs] or [examples][examples] directory of this repo)
@ -451,7 +450,7 @@ To disable these, add this to your `Cargo.toml`:
```toml
[dependencies.clap]
version = "3.0.0-beta.4"
version = "3.0.0-beta.5"
default-features = false
features = ["std"]
```
@ -460,7 +459,7 @@ You can also selectively enable only the features you'd like to include, by addi
```toml
[dependencies.clap]
version = "3.0.0-beta.4"
version = "3.0.0-beta.5"
default-features = false
# Cherry-pick the features you'd like to use
@ -522,7 +521,7 @@ In order to keep from being surprised of breaking changes, it is **highly** reco
```toml
[dependencies]
clap = "~3.0.0-beta.4"
clap = "~3.0.0-beta.5"
```
This will cause *only* the patch version to be updated upon a `cargo update` call, and therefore cannot break due to new features, or bumped minimum versions of Rust.

View file

@ -1,6 +1,6 @@
[package]
name = "clap_derive"
version = "3.0.0-beta.4"
version = "3.0.0-beta.5"
edition = "2018"
authors = [
"Guillaume Pinot <texitoi@texitoi.eu>",

View file

@ -13,7 +13,7 @@
// MIT/Apache 2.0 license.
#![doc(html_logo_url = "https://clap.rs/images/media/clap.png")]
#![doc(html_root_url = "https://docs.rs/clap_derive/3.0.0-beta.4")]
#![doc(html_root_url = "https://docs.rs/clap_derive/3.0.0-beta.5")]
//! This crate is custom derive for clap. It should not be used
//! directly. See [clap documentation](http://docs.rs/clap)

View file

@ -1,6 +1,6 @@
[package]
name = "clap_generate"
version = "3.0.0-beta.4"
version = "3.0.0-beta.5"
edition = "2018"
authors = [
"Kevin K. <kbknapp@gmail.com>",
@ -30,7 +30,7 @@ readme = "README.md"
bench = false
[dependencies]
clap = { path = "../", version = "=3.0.0-beta.4", default-features = false, features = ["std"] }
clap = { path = "../", version = "=3.0.0-beta.5", default-features = false, features = ["std"] }
[dev-dependencies]
pretty_assertions = "0.7"

View file

@ -6,7 +6,7 @@
// for more information.
#![doc(html_logo_url = "https://clap.rs/images/media/clap.png")]
#![doc(html_root_url = "https://docs.rs/clap_generate/3.0.0-beta.4")]
#![doc(html_root_url = "https://docs.rs/clap_generate/3.0.0-beta.5")]
#![doc = include_str!("../README.md")]
#![deny(missing_docs, trivial_casts, unused_allocation, trivial_numeric_casts)]
#![forbid(unsafe_code)]

View file

@ -1,6 +1,6 @@
[package]
name = "clap_generate_fig"
version = "3.0.0-beta.4"
version = "3.0.0-beta.5"
edition = "2018"
authors = [
"Clap Maintainers"
@ -30,8 +30,8 @@ readme = "README.md"
bench = false
[dependencies]
clap = { path = "../", version = "=3.0.0-beta.4" }
clap_generate = { path = "../clap_generate", version = "3.0.0-beta.4" }
clap = { path = "../", version = "=3.0.0-beta.5" }
clap_generate = { path = "../clap_generate", version = "=3.0.0-beta.5" }
[dev-dependencies]
pretty_assertions = "0.7"

View file

@ -6,7 +6,7 @@
//! Generates [Fig](https://github.com/withfig/autocomplete) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs
#![doc(html_logo_url = "https://clap.rs/images/media/clap.png")]
#![doc(html_root_url = "https://docs.rs/clap_generate_fig/3.0.0-beta.4")]
#![doc(html_root_url = "https://docs.rs/clap_generate_fig/3.0.0-beta.5")]
#![deny(missing_docs, trivial_casts, unused_allocation, trivial_numeric_casts)]
#![forbid(unsafe_code)]
#![allow(clippy::needless_doctest_main)]

View file

@ -72,6 +72,7 @@ pub fn runner() -> Runner {
["version_short", "mut_arg"],
["help_message", "mut_arg"],
["help_short", "mut_arg"],
["generate_usage", "render_usage"],
],
)
.rename_methods(

View file

@ -38,6 +38,12 @@ impl<'help> From<&'help str> for ArgValue<'help> {
}
}
impl<'help> From<&'help &'help str> for ArgValue<'help> {
fn from(s: &'help &'help str) -> Self {
Self::new(s)
}
}
/// Getters
impl<'help> ArgValue<'help> {
/// Get the name of the argument value

View file

@ -4,7 +4,7 @@
// notice may not be copied, modified, or distributed except according to those terms.
#![doc(html_logo_url = "https://clap.rs/images/media/clap.png")]
#![doc(html_root_url = "https://docs.rs/clap/3.0.0-beta.4")]
#![doc(html_root_url = "https://docs.rs/clap/3.0.0-beta.5")]
#![doc = include_str!("../README.md")]
//! <https://github.com/clap-rs/clap>
#![crate_type = "lib"]

View file

@ -711,7 +711,7 @@ fn required_if_val_present_fail_error_output() {
Arg::new("target")
.takes_value(true)
.required(true)
.possible_values(["file", "stdout"])
.possible_values(&["file", "stdout"])
.long("target"),
)
.arg(