diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2023-03-12 08:07:35 +0100 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2023-03-12 08:07:35 +0100 |
commit | 22f54dd7c0e83b55e0acc2fb1a10ab487bdeb9fb (patch) | |
tree | 3908c3cb25c86dc24006422424cd634cb6ddd0fa | |
parent | 658c676be779655165e5c5462873c8e828e710f2 (diff) | |
parent | b474b8146de6ce925098b08a1d6af62aa0c25f77 (diff) |
feat: use metric byte format only on MacOS. (#85)
That way, on linux the binary format is used by default which is more common
on that platform.
-rw-r--r-- | src/options.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/options.rs b/src/options.rs index e618f78..ab48980 100644 --- a/src/options.rs +++ b/src/options.rs @@ -26,6 +26,14 @@ impl From<ByteFormat> for LibraryByteFormat { } } +fn dft_format() -> ByteFormat { + if std::env::consts::OS == "macos" { + ByteFormat::Metric + } else { + ByteFormat::Binary + } +} + /// A tool to learn about disk usage, fast! #[derive(Debug, clap::Parser)] #[clap(name = "dua", version)] @@ -51,7 +59,7 @@ pub struct Args { short = 'f', long, value_enum, - default_value_t = ByteFormat::Metric, + default_value_t = dft_format(), ignore_case = true, hide_default_value = true, hide_possible_values = true |