Repository: sharkdp/hyperfine
File: src/cli.rs (Rust)

Code before:
                .takes_value(true)
                .value_name("FILE")
                .help("Export the timing summary statistics as a Markdown table to the given FILE."),
        )
        .arg(
            Arg::new("show-output")
                .long("show-output")
                .conflicts_with("style")
                .help(
                    "Print the stdout and stderr of the benchmark instead of suppressing it. \
                     This will increase the time it takes for benchmarks to run, \
                     so it should only be used for debugging purposes or \
                     when trying to benchmark output speed.",
                ),
        )
        .arg(
            Arg::new("output")
                .long("output")
                .conflicts_with("show-output")
                .takes_value(true)
                .value_name("WHERE")
                .help(
                    "Control where the output of the benchmark is redirected.\n\n  \
                     null: Redirect output to /dev/null (the default).\n\n  \
                     pipe: Feed the output through a pipe before discarding it.\n        \
                     Useful if the benchmark special-cases /dev/null.\n\n  \
                     <FILE>: Write the output to the given file.",
                ),
        )
        .arg(
            Arg::new("command-name")
                .long("command-name")
                .short('n')
                .takes_value(true)
                .multiple_occurrences(true)
                .number_of_values(1)
                .value_name("NAME")
                .help("Give a meaningful name to a command. This can be specified multiple times \
                       if several commands are benchmarked."),
        )
        .arg(
            Arg::new("debug-mode")
            .long("debug-mode")
            .hide(true)
            .help("Enable debug mode which does not actually run commands, but returns fake times when the command is 'sleep <time>'")
        )
}

#[test]
fn verify_app() {
    build_command().debug_assert();

Review comment (suggestion):
I'm not sure if most users would understand the "Useful if the benchmark special-cases /dev/null" part. It would be great if we could try to make this easier somehow. Maybe by writing under `null`: "Note that some programs like 'grep' detect that the output goes to /dev/null, allowing them to enable certain optimizations. If you want to avoid that, consider using '--output=pipe'".

Code after:
                .takes_value(true)
                .value_name("FILE")
                .help("Export the timing summary statistics as a Markdown table to the given FILE."),
        )
        .arg(
            Arg::new("show-output")
                .long("show-output")
                .conflicts_with("style")
                .help(
                    "Print the stdout and stderr of the benchmark instead of suppressing it. \
                     This will increase the time it takes for benchmarks to run, \
                     so it should only be used for debugging purposes or \
                     when trying to benchmark output speed.",
                ),
        )
        .arg(
            Arg::new("output")
                .long("output")
                .conflicts_with("show-output")
                .takes_value(true)
                .value_name("WHERE")
                .help(
                    "Control where the output of the benchmark is redirected. <WHERE> can be:\n\n\
                     null: Redirect output to /dev/null (the default). \
                     Note that some programs like 'grep' detect when standard output is /dev/null \
                     and apply certain optimizations. To avoid that, consider using \
                     '--output=pipe'.\n\n\
                     pipe: Feed the output through a pipe before discarding it.\n\n\
                     inherit: Don't redirect the output at all (same as '--show-output').\n\n\
                     <FILE>: Write the output to the given file.",
                ),
        )
        .arg(
            Arg::new("command-name")
                .long("command-name")
                .short('n')
                .takes_value(true)
                .multiple_occurrences(true)
                .number_of_values(1)
                .value_name("NAME")
                .help("Give a meaningful name to a command. This can be specified multiple times \
                       if several commands are benchmarked."),
        )
        .arg(
            Arg::new("debug-mode")
            .long("debug-mode")
            .hide(true)
            .help("Enable debug mode which does not actually run commands, but returns fake times when the command is 'sleep <time>'")
        )
}