diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2023-03-12 08:17:26 +0100 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2023-03-12 08:17:26 +0100 |
commit | d0e85fec1586a8937928472e361837ef21e40b14 (patch) | |
tree | 1dd34d3b03bbf2eae2409d826407303f8c3e210e | |
parent | 22f54dd7c0e83b55e0acc2fb1a10ab487bdeb9fb (diff) |
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.
-rw-r--r-- | src/options.rs | 13 |
1 files 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<ByteFormat> 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, |