Files
bottom/schema
Peder Bergan c10a2adbd4 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.
2026-09-15 20:47:06 -04:00
..
2025-11-06 23:26:15 +08:00
2026-08-27 03:09:45 -04:00

Config JSON Schema

Generation

These are automatically generated from the code using schemars. The schemars derives are locked behind the generate_schema feature flag to avoid building unnecessary code for normal builds. Meanwhile, the generator itself lives in a separate scripts/schema_gen helper crate. You can generate them like so:

# Will print out to stdout
cargo run --manifest-path scripts/schema_gen/Cargo.toml

# e.g. for nightly
cargo run --manifest-path scripts/schema_gen/Cargo.toml > schema/nightly/bottom.json

# e.g. for a specific version
cargo run --manifest-path scripts/schema_gen/Cargo.toml -- 0.12.0 > schema/v0.12.0/bottom.json

Alternatively, run the scripts/schema/generate.sh script (for stable releases) or scripts/schema/nightly.sh (for nightly), which does all of this for you.

Publication

To publish these schemas:

Stable

  1. Run scripts/schema/generate.sh <YOUR_VERSION>.
  2. Make a PR and merge it.
  3. Then, make a PR to schemastore to update the catalog. Here's an example of a PR.

Nightly

  1. Run scripts/schema/nightly.sh.
  2. Make a PR and merge it.