mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 06:12:40 +00:00
parent
5ebcb4c3bf
commit
b6432c8ead
3 changed files with 57 additions and 2 deletions
38
Cargo.lock
generated
38
Cargo.lock
generated
|
@ -208,6 +208,7 @@ dependencies = [
|
|||
"backtrace",
|
||||
"bitflags",
|
||||
"clap_lex 0.4.0",
|
||||
"color-print",
|
||||
"humantime",
|
||||
"once_cell",
|
||||
"rustversion",
|
||||
|
@ -278,6 +279,27 @@ dependencies = [
|
|||
"snapbox",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "color-print"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2a5e6504ed8648554968650feecea00557a3476bc040d0ffc33080e66b646d0"
|
||||
dependencies = [
|
||||
"color-print-proc-macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "color-print-proc-macro"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d51beaa537d73d2d1ff34ee70bc095f170420ab2ec5d687ecd3ec2b0d092514b"
|
||||
dependencies = [
|
||||
"nom",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "concolor-override"
|
||||
version = "1.0.0"
|
||||
|
@ -579,6 +601,12 @@ dependencies = [
|
|||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "minimal-lexical"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.6.2"
|
||||
|
@ -588,6 +616,16 @@ dependencies = [
|
|||
"adler",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "normalize-line-endings"
|
||||
version = "0.3.0"
|
||||
|
|
|
@ -80,3 +80,4 @@ snapbox = "0.4.10"
|
|||
shlex = "1.1.0"
|
||||
static_assertions = "1.1.0"
|
||||
unic-emoji-char = "0.9.0"
|
||||
color-print = "0.3.4"
|
||||
|
|
|
@ -1,7 +1,23 @@
|
|||
/// Terminal-styling container
|
||||
///
|
||||
/// For now, this is the same as a [`Str`][crate::builder::Str]. This exists to reserve space in
|
||||
/// the API for exposing terminal styling.
|
||||
/// Styling may be encoded as [ANSI Escape Code](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// # use clap_builder as clap;
|
||||
/// // `cstr!` converts tags to ANSI codes
|
||||
/// let after_help: &'static str = color_print::cstr!(
|
||||
/// r#"<bold><underline>Examples</underline></bold>
|
||||
///
|
||||
/// <dim>$</dim> <bold>mybin --input file.toml</bold>
|
||||
/// "#);
|
||||
///
|
||||
/// let cmd = clap::Command::new("mybin")
|
||||
/// .after_help(after_help) // The `&str` gets converted into a `StyledStr`
|
||||
/// // ...
|
||||
/// # ;
|
||||
/// ```
|
||||
#[derive(Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct StyledStr(String);
|
||||
|
||||
|
|
Loading…
Reference in a new issue