mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
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 https://github.com/clap-rs/clap/issues/2924
This commit is contained in:
parent
c0ac536cb7
commit
bfa388420b
8 changed files with 17 additions and 12 deletions
4
.github/workflows/ci-pr.yml
vendored
4
.github/workflows/ci-pr.yml
vendored
|
@ -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:
|
||||
|
@ -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
|
||||
|
|
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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
.github/workflows/coverage.yml
vendored
2
.github/workflows/coverage.yml
vendored
|
@ -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:
|
||||
|
|
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
|
@ -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:
|
||||
|
|
|
@ -118,6 +118,7 @@ yaml = ["yaml-rust"]
|
|||
# In-work features
|
||||
unstable-replace = []
|
||||
unstable-multicall = []
|
||||
unstable-grouped = []
|
||||
|
||||
[profile.test]
|
||||
opt-level = 1
|
||||
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![cfg(feature = "unstable-grouped")]
|
||||
|
||||
mod utils;
|
||||
|
||||
use clap::{App, AppSettings, Arg};
|
||||
|
|
Loading…
Reference in a new issue