From d0e85fec1586a8937928472e361837ef21e40b14 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 12 Mar 2023 08:17:26 +0100 Subject: feat: improve CLI help provided with the `--format` flag. It's now possible to see what possible values are without reading a swath of text. Now the default is shown as well which is more important now that it changes depending on the platform. --- src/options.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/options.rs b/src/options.rs index ab48980..6711795 100644 --- a/src/options.rs +++ b/src/options.rs @@ -27,7 +27,7 @@ impl From for LibraryByteFormat { } fn dft_format() -> ByteFormat { - if std::env::consts::OS == "macos" { + if cfg!(target_vendor = "apple") { ByteFormat::Metric } else { ByteFormat::Binary @@ -47,22 +47,13 @@ pub struct Args { #[clap(short = 't', long = "threads", default_value_t = 0)] pub threads: usize, - /// The format with which to print byte counts: - /// metric - uses 1000 as base (default), - /// binary - uses 1024 as base, - /// bytes - plain bytes without any formatting, - /// GB - only gigabytes, - /// GiB - only gibibytes, - /// MB - only megabytes, - /// MiB - only mebibytes + /// The format with which to print byte counts. #[clap( short = 'f', long, value_enum, default_value_t = dft_format(), ignore_case = true, - hide_default_value = true, - hide_possible_values = true )] pub format: ByteFormat, -- cgit v1.2.3