Skip to content

Commit

Permalink
Merge #2926 #2948
Browse files Browse the repository at this point in the history
2926: Put `grouped_values_of` behind a feature gate r=pksunkara a=epage



2948: docs(generate): Move derive example to generate r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
  • Loading branch information
bors[bot] and epage committed Oct 26, 2021
3 parents 07fcaa9 + bfa3884 + a065702 commit f9e074e
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
test-full:
name: Tests (Full)
env:
FLAGS: --features 'wrap_help yaml regex unstable-replace unstable-multicall'
FLAGS: --features 'wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Default features
run: cargo check --all-targets
- name: All features + Debug
run: cargo check --all-targets --features "wrap_help yaml regex unstable-replace unstable-multicall debug"
run: cargo check --all-targets --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped debug"
- name: No features
run: cargo check --all-targets --no-default-features --features "std cargo"
- name: UI Tests
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ jobs:
if: matrix.features == 'all'
with:
command: test
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall"
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped"
- name: Check debug
uses: actions-rs/cargo@v1
if: matrix.features == 'all'
with:
command: check
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall debug"
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped debug"
- name: Test release
uses: actions-rs/cargo@v1
if: matrix.features == 'release'
with:
command: test
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall" --release
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped" --release
nightly:
name: Nightly Tests
strategy:
Expand Down Expand Up @@ -139,19 +139,19 @@ jobs:
if: matrix.features == 'all'
with:
command: test
args: --features "wrap_help yaml regex unstable-replace unstable-multicall"
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped"
- name: Check debug
uses: actions-rs/cargo@v1
if: matrix.features == 'all'
with:
command: check
args: --features "wrap_help yaml regex unstable-replace unstable-multicall debug"
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped debug"
- name: Test release
uses: actions-rs/cargo@v1
if: matrix.features == 'release'
with:
command: test
args: --features "wrap_help yaml regex unstable-replace unstable-multicall" --release
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped" --release
wasm:
name: Wasm Check
runs-on: ubuntu-latest
Expand All @@ -172,4 +172,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: check
args: --target ${{ matrix.target }} --features "yaml regex unstable-replace unstable-multicall"
args: --target ${{ matrix.target }} --features "yaml regex unstable-replace unstable-multicall unstable-grouped"
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: --features "wrap_help yaml regex unstable-replace unstable-multicall" --lcov --output-path lcov.info
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped" --lcov --output-path lcov.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --features "wrap_help yaml regex unstable-replace unstable-multicall" -- -D warnings
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped" -- -D warnings
- name: Format check
uses: actions-rs/cargo@v1
with:
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ yaml = ["yaml-rust"]
# In-work features
unstable-replace = []
unstable-multicall = []
unstable-grouped = []

[profile.test]
opt-level = 1
Expand All @@ -127,7 +128,7 @@ lto = true
codegen-units = 1

[package.metadata.docs.rs]
features = ["yaml", "regex", "unstable-replace", "unstable-multicall"]
features = ["yaml", "regex", "unstable-replace", "unstable-multicall", "unstable-grouped"]
targets = ["x86_64-unknown-linux-gnu"]

[workspace]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ These features are opt-in. But be wary that they can contain breaking changes be

* **unstable-replace**: Enable [`App::replace`](https://github.com/clap-rs/clap/issues/2836)
* **unstable-multicall**: Enable [`AppSettings::Multicall`](https://github.com/clap-rs/clap/issues/2861)
* **unstable-grouped**: Enable [`ArgMatches::grouped_values_of`](https://github.com/clap-rs/clap/issues/2924)

### More Information

Expand Down
1 change: 0 additions & 1 deletion clap_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ proc-macro-error = "1"

[dev-dependencies]
clap = { path = "../" }
clap_generate = { path = "../clap_generate" }
trybuild = "1.0"
rustversion = "1"
version-sync = "0.9"
Expand Down
1 change: 1 addition & 0 deletions clap_generate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ clap = { path = "../", version = "=3.0.0-beta.5", default-features = false, feat
[dev-dependencies]
pretty_assertions = "0.7"
version-sync = "0.9"
clap = { path = "../", version = "=3.0.0-beta.5", default-features = false, features = ["std", "derive"] }

[features]
default = []
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/parse/matches/arg_matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ impl ArgMatches {
}

/// Placeholder documentation.
#[cfg(feature = "unstable-grouped")]
pub fn grouped_values_of<T: Key>(&self, id: T) -> Option<GroupedValues> {
#[allow(clippy::type_complexity)]
let arg_values: for<'a> fn(
Expand Down
2 changes: 2 additions & 0 deletions tests/grouped_values.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "unstable-grouped")]

mod utils;

use clap::{App, AppSettings, Arg};
Expand Down

0 comments on commit f9e074e

Please sign in to comment.