Skip to content

Commit

Permalink
bins: Add after_text for RAYON_NUM_THREADS
Browse files Browse the repository at this point in the history
  • Loading branch information
wcampbell0x2a committed Jul 21, 2023
1 parent 1a9b33a commit e1b1872
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions common/common.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Compiled for every binary, as this is not a workspce. Don't put many functinos in this file

pub fn after_help() -> String {
pub fn after_help(rayon_env: bool) -> String {
let mut s = "Decompressors available:\n".to_string();

#[cfg(feature = "gzip")]
Expand All @@ -15,7 +15,13 @@ pub fn after_help() -> String {
#[cfg(feature = "zstd")]
s.push_str("\tzstd\n");

s.push_str("\nEnvironment Variables:\n\t");
s.push_str(r#"RUST_LOG: See "https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/index.html#filtering-events-with-environment-variables""#);
s.push_str("\nEnvironment Variables:\n");
s.push_str(" RUST_LOG:");
s.push_str(r#" "https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/index.html#filtering-events-with-environment-variables""#);
if rayon_env {
s.push('\n');
s.push_str(" RAYON_NUM_THREADS:");
s.push_str(r#" "https://docs.rs/rayon/latest/rayon/struct.ThreadPoolBuilder.html#method.num_threads""#);
}
s
}
2 changes: 1 addition & 1 deletion src/bin/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
#[command(author,
version,
name = "add-backhand",
after_help = after_help(),
after_help = after_help(false),
max_term_width = 98,
)]
struct Args {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
#[command(author,
version,
name = "replace-backhand",
after_help = after_help(),
after_help = after_help(false),
max_term_width = 98,
)]
struct Args {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/unsquashfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn failed(pb: &ProgressBar, s: &str) {
#[command(author,
version,
name = "unsquashfs-backhand",
after_help = after_help(),
after_help = after_help(true),
max_term_width = 98,
)]
struct Args {
Expand Down

0 comments on commit e1b1872

Please sign in to comment.