Skip to content

Commit bfa3884

Browse files
committed
Put grouped_values_of behind a feature gate
There is enough open work on this, we should probably not have it public yet, so putting it behind a gate. See clap-rs#2924
1 parent c0ac536 commit bfa3884

File tree

8 files changed

+17
-12
lines changed

8 files changed

+17
-12
lines changed

.github/workflows/ci-pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
test-full:
4242
name: Tests (Full)
4343
env:
44-
FLAGS: --features 'wrap_help yaml regex unstable-replace unstable-multicall'
44+
FLAGS: --features 'wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped'
4545
strategy:
4646
fail-fast: false
4747
matrix:
@@ -80,7 +80,7 @@ jobs:
8080
- name: Default features
8181
run: cargo check --all-targets
8282
- name: All features + Debug
83-
run: cargo check --all-targets --features "wrap_help yaml regex unstable-replace unstable-multicall debug"
83+
run: cargo check --all-targets --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped debug"
8484
- name: No features
8585
run: cargo check --all-targets --no-default-features --features "std cargo"
8686
- name: UI Tests

.github/workflows/ci.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,19 @@ jobs:
9797
if: matrix.features == 'all'
9898
with:
9999
command: test
100-
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall"
100+
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped"
101101
- name: Check debug
102102
uses: actions-rs/cargo@v1
103103
if: matrix.features == 'all'
104104
with:
105105
command: check
106-
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall debug"
106+
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped debug"
107107
- name: Test release
108108
uses: actions-rs/cargo@v1
109109
if: matrix.features == 'release'
110110
with:
111111
command: test
112-
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall" --release
112+
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped" --release
113113
nightly:
114114
name: Nightly Tests
115115
strategy:
@@ -139,19 +139,19 @@ jobs:
139139
if: matrix.features == 'all'
140140
with:
141141
command: test
142-
args: --features "wrap_help yaml regex unstable-replace unstable-multicall"
142+
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped"
143143
- name: Check debug
144144
uses: actions-rs/cargo@v1
145145
if: matrix.features == 'all'
146146
with:
147147
command: check
148-
args: --features "wrap_help yaml regex unstable-replace unstable-multicall debug"
148+
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped debug"
149149
- name: Test release
150150
uses: actions-rs/cargo@v1
151151
if: matrix.features == 'release'
152152
with:
153153
command: test
154-
args: --features "wrap_help yaml regex unstable-replace unstable-multicall" --release
154+
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped" --release
155155
wasm:
156156
name: Wasm Check
157157
runs-on: ubuntu-latest
@@ -172,4 +172,4 @@ jobs:
172172
uses: actions-rs/cargo@v1
173173
with:
174174
command: check
175-
args: --target ${{ matrix.target }} --features "yaml regex unstable-replace unstable-multicall"
175+
args: --target ${{ matrix.target }} --features "yaml regex unstable-replace unstable-multicall unstable-grouped"

.github/workflows/coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions-rs/cargo@v1
3232
with:
3333
command: llvm-cov
34-
args: --features "wrap_help yaml regex unstable-replace unstable-multicall" --lcov --output-path lcov.info
34+
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped" --lcov --output-path lcov.info
3535
- name: Coveralls
3636
uses: coverallsapp/github-action@master
3737
with:

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions-rs/cargo@v1
3333
with:
3434
command: clippy
35-
args: --features "wrap_help yaml regex unstable-replace unstable-multicall" -- -D warnings
35+
args: --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped" -- -D warnings
3636
- name: Format check
3737
uses: actions-rs/cargo@v1
3838
with:

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ yaml = ["yaml-rust"]
118118
# In-work features
119119
unstable-replace = []
120120
unstable-multicall = []
121+
unstable-grouped = []
121122

122123
[profile.test]
123124
opt-level = 1
@@ -127,7 +128,7 @@ lto = true
127128
codegen-units = 1
128129

129130
[package.metadata.docs.rs]
130-
features = ["yaml", "regex", "unstable-replace", "unstable-multicall"]
131+
features = ["yaml", "regex", "unstable-replace", "unstable-multicall", "unstable-grouped"]
131132
targets = ["x86_64-unknown-linux-gnu"]
132133

133134
[workspace]

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ These features are opt-in. But be wary that they can contain breaking changes be
478478

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

482483
### More Information
483484

src/parse/matches/arg_matches.rs

+1
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ impl ArgMatches {
247247
}
248248

249249
/// Placeholder documentation.
250+
#[cfg(feature = "unstable-grouped")]
250251
pub fn grouped_values_of<T: Key>(&self, id: T) -> Option<GroupedValues> {
251252
#[allow(clippy::type_complexity)]
252253
let arg_values: for<'a> fn(

tests/grouped_values.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(feature = "unstable-grouped")]
2+
13
mod utils;
24

35
use clap::{App, AppSettings, Arg};

0 commit comments

Comments
 (0)