1use clap::builder::styling::*;
3#[doc(hidden)]
4pub fn styles() -> clap::builder::Styles {
5 Styles::styled()
6 .header(AnsiColor::Green.on_default() | Effects::BOLD)
7 .usage(AnsiColor::Green.on_default() | Effects::BOLD)
8 .literal(AnsiColor::Cyan.on_default() | Effects::BOLD)
9 .placeholder(AnsiColor::Cyan.on_default())
10 .error(AnsiColor::Red.on_default() | Effects::BOLD)
11 .valid(AnsiColor::Cyan.on_default() | Effects::BOLD)
12 .invalid(AnsiColor::Yellow.on_default() | Effects::BOLD)
13}
14
15#[doc(hidden)]
16pub fn after_help(rayon_env: bool) -> String {
17 let mut s = String::new();
18
19 let header = color_print::cstr!("<green, bold>Decompressors available:</>\n");
20 s.push_str(header);
21
22 #[cfg(feature = "any-gzip")]
23 s.push_str(color_print::cstr!(" <cyan, bold>gzip\n"));
24
25 #[cfg(feature = "xz")]
26 s.push_str(color_print::cstr!(" <cyan, bold>xz\n"));
27
28 #[cfg(feature = "lzo")]
29 s.push_str(color_print::cstr!(" <cyan, bold>lzo\n"));
30
31 #[cfg(feature = "zstd")]
32 s.push_str(color_print::cstr!(" <cyan, bold>zstd\n"));
33
34 #[cfg(feature = "v3")]
35 s.push_str(color_print::cstr!(" <cyan, bold>v3: gzip\n"));
36
37 #[cfg(feature = "v3_lzma")]
38 s.push_str(color_print::cstr!(" <cyan, bold>v3: lzma\n"));
39
40 s.push_str(color_print::cstr!("<green, bold>Environment Variables:\n"));
41 s.push_str(color_print::cstr!(" <cyan, bold>RUST_LOG:"));
42 s.push_str(" https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/index.html#filtering-events-with-environment-variables");
43 if rayon_env {
44 s.push('\n');
45 s.push_str(color_print::cstr!(" <cyan, bold>RAYON_NUM_THREADS:"));
46 s.push_str(r#" https://docs.rs/rayon/latest/rayon/struct.ThreadPoolBuilder.html#method.num_threads"#);
47 }
48 s
49}