Describe behaviour directly instead of by reference to the Go version

- platform::mode documents the on-disk mode-bit layout (bits 31..19 =
  d a l T L D p S u g c t ?, low 9 bits = permissions).
- The snapshot module documents the LEB128 / zig-zag varints and the RFC
  3339 JSON timestamps, and states that snapshots written by mapsize 1.x
  load unchanged.
- Renames: GoTime -> JsonTime, go_duration -> fmt_duration, fixture
  testdata/go.msz -> testdata/v1.2.0.msz (a snapshot written by mapsize
  1.2.0), loads_go_snapshot -> loads_1_2_snapshot.
- --log / --log-level help says they are accepted and ignored.
This commit is contained in:
Andy Dixon
2026-10-08 20:08:34 +01:00
parent fcac50bae6
commit 9179281a94
19 changed files with 113 additions and 92 deletions
+4 -4
View File
@@ -5,7 +5,7 @@ use mapsize::inventory::SizeMode;
use mapsize::{brand, config, scan, snapshot, textutil};
use std::path::Path;
/// Flags taking a value (Go's flag package: `-f v`, `-f=v`, `--f v`, `--f=v`).
/// Flags taking a value, written `-f v`, `-f=v`, `--f v` or `--f=v`.
const VALUE_FLAGS: &[&str] = &[
"workers",
"follow-symlinks",
@@ -71,8 +71,8 @@ Flags:
--theme NAME colour theme: default, dark, high-contrast, mono
--color MODE colour support: auto, truecolor, 256, 16, none
--no-mouse disable mouse support
--log FILE write a debug log to FILE
--log-level LEVEL log level: error, warn, info, debug, trace
--log FILE accepted for compatibility; ignored
--log-level LEVEL accepted for compatibility (error, warn, info, debug, trace); ignored
--version print version and exit
"
);
@@ -171,7 +171,7 @@ fn run(args: Vec<String>) -> i32 {
return fail(format!("invalid --log-level {l:?}"));
}
}
// ponytail: --log is accepted for CLI compatibility; the Rust port has no debug logging yet.
// ponytail: --log and --log-level are accepted for compatibility and ignored; there is no debug logging.
let (depth, top, largest) = match (int("depth", -1), int("top", 0), int("largest-files", 0)) {
(Ok(d), Ok(t), Ok(l)) => (d, t.max(0) as usize, l.max(0) as usize),