From c10a2adbd4e340d337bfe2ccb319f59ec8de0533 Mon Sep 17 00:00:00 2001 From: Peder Bergan Date: Wed, 16 Sep 2026 02:47:06 +0200 Subject: [PATCH] feat: add configurable binary disk capacity units (#2236) Enable binary disk capacity units with: ```toml [disk] use_binary_prefix = true ``` Or pass `--disk_use_binary_prefix` (alias `--disk-use-binary-prefix`). The CLI flag takes precedence over a false config setting. Decimal units remain the default. Used, Free, and Total use the existing binary conversion helper. For example, 536,870,912,000 bytes changes from `537GB` to `500GiB`. Percentages, sorting by raw byte values, I/O rates, and network units retain their existing behavior. The change passes the option from argument/config parsing through application settings and collected disk data to cell formatting. Four regression tests cover option precedence and both CLI spellings, collection-to-cell wiring, unit boundaries, missing values, percentages, I/O behavior, and sorting. --- .../configuration/command-line-options.md | 6 + .../configuration/config-file/disk-table.md | 10 ++ sample_configs/default_config.toml | 3 + schema/nightly/bottom.json | 7 ++ src/app.rs | 1 + src/app/data/store.rs | 8 +- src/constants.rs | 3 + src/options.rs | 6 + src/options/args.rs | 18 +++ src/options/config/disk.rs | 4 + src/widgets/disk_table.rs | 109 +++++++++++++++++- 11 files changed, 169 insertions(+), 6 deletions(-) diff --git a/docs/content/configuration/command-line-options.md b/docs/content/configuration/command-line-options.md index 42800931..bd85bd50 100644 --- a/docs/content/configuration/command-line-options.md +++ b/docs/content/configuration/command-line-options.md @@ -25,6 +25,12 @@ see information on these options by running `btm -h`, or run `btm --help` to dis | | for table widgets. | | `-d`, `--time_delta