Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb53db8

Browse files
committed
feat(help): Stabilize styling support
Fixes #3234
1 parent f664841 commit eb53db8

9 files changed

Lines changed: 3 additions & 17 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ _FEATURES = minimal default wasm full debug release
1616
_FEATURES_minimal = --no-default-features --features "std"
1717
_FEATURES_default =
1818
_FEATURES_wasm = --no-default-features --features "std help usage error-context suggestions" --features "deprecated derive cargo env unicode string"
19-
_FEATURES_full = --features "deprecated derive cargo env unicode string wrap_help unstable-styles"
19+
_FEATURES_full = --features "deprecated derive cargo env unicode string wrap_help"
2020
_FEATURES_next = ${_FEATURES_full} --features unstable-v5
2121
_FEATURES_debug = ${_FEATURES_full} --features debug --features clap_complete/debug
2222
_FEATURES_release = ${_FEATURES_full} --release

clap_builder/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tag-name = "v{{version}}"
3232
[features]
3333
default = ["std", "color", "help", "usage", "error-context", "suggestions"]
3434
debug = ["dep:backtrace"] # Enables debug messages
35-
unstable-doc = ["cargo", "wrap_help", "env", "unicode", "string", "unstable-styles"] # for docs.rs
35+
unstable-doc = ["cargo", "wrap_help", "env", "unicode", "string"] # for docs.rs
3636

3737
# Used in default
3838
std = ["anstyle/std"] # support for no_std in a backwards-compatible way

clap_builder/src/builder/command.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,6 @@ impl Command {
11701170
#[cfg(feature = "color")]
11711171
#[inline]
11721172
#[must_use]
1173-
#[cfg(feature = "unstable-styles")]
11741173
pub fn styles(mut self, styles: Styles) -> Self {
11751174
self.app_ext.set(styles);
11761175
self

clap_builder/src/builder/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ mod debug_asserts;
2323
#[cfg(test)]
2424
mod tests;
2525

26-
#[cfg(feature = "unstable-styles")]
2726
pub mod styling;
28-
#[cfg(not(feature = "unstable-styles"))]
29-
pub(crate) mod styling;
3027

3128
pub use self::str::Str;
3229
pub use action::ArgAction;
@@ -40,7 +37,6 @@ pub use range::ValueRange;
4037
pub use resettable::IntoResettable;
4138
pub use resettable::Resettable;
4239
pub use styled_str::StyledStr;
43-
#[cfg(feature = "unstable-styles")]
4440
pub use styling::Styles;
4541
pub use value_hint::ValueHint;
4642
pub use value_parser::_AutoValueParser;
@@ -69,5 +65,3 @@ pub(crate) use self::str::Inner as StrInner;
6965
pub(crate) use action::CountType;
7066
pub(crate) use arg_settings::{ArgFlags, ArgSettings};
7167
pub(crate) use command::AppTag;
72-
#[cfg(not(feature = "unstable-styles"))]
73-
pub(crate) use styling::Styles;

clap_builder/src/builder/styling.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ pub use anstyle::*;
1010
///
1111
/// clap v3 styling
1212
/// ```rust
13-
/// # #[cfg(feature = "unstable-styles")] {
1413
/// # use clap_builder as clap;
1514
/// # use clap::builder::styling::*;
1615
/// let styles = Styles::styled()
1716
/// .header(AnsiColor::Yellow.on_default())
1817
/// .usage(AnsiColor::Green.on_default())
1918
/// .literal(AnsiColor::Green.on_default())
2019
/// .placeholder(AnsiColor::Green.on_default());
21-
/// # }
2220
/// ```
2321
#[derive(Clone, Debug)]
2422
#[allow(missing_copy_implementations)] // Large enough type that I want an explicit `clone()` for now

src/_features.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@
2626
//! **Warning:** These may contain breaking changes between minor releases.
2727
//!
2828
//! * **unstable-v5**: Preview features which will be stable on the v5.0 release
29-
//! * **unstable-styles**: Custom theming support for clap

src/bin/stdio-fixture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
.action(clap::ArgAction::SetTrue)
1313
.long_help("more log"),
1414
);
15-
#[cfg(feature = "unstable-styles")]
15+
#[cfg(feature = "color")]
1616
{
1717
use clap::builder::styling;
1818
let styles = styling::Styles::styled()

tests/examples.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ fn example_tests() {
3636
// In-work
3737
//#[cfg(feature = "unstable-v5")] // Currently has failures
3838
//"unstable-v5",
39-
#[cfg(feature = "unstable-styles")]
40-
"unstable-styles",
4139
]
4240
.join(" ");
4341
t.register_bins(trycmd::cargo::compile_examples(["--features", &features]).unwrap());

tests/ui.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ fn ui_tests() {
3636
// In-work
3737
//#[cfg(feature = "unstable-v5")] // Currently has failures
3838
//"unstable-v5",
39-
#[cfg(feature = "unstable-styles")]
40-
"unstable-styles",
4139
]
4240
.join(" ");
4341
t.register_bins(trycmd::cargo::compile_examples(["--features", &features]).unwrap());

0 commit comments

Comments
 (0)