dm2-cli: low-severity batch (extract/render --all leave stale files in a reused output dir; broken-pipe panic on truncated stdout) #244
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two low-severity dm2-cli behaviours.
1.
extract/render --allnever clear or guard a pre-populated output dircrates/dm2-cli/src/commands/extract.rshas no non-empty-output-directory check,unlike
repack(crates/dm2-cli/src/commands/repack.rs:278-305), which guards anon-empty
outbehind--forceand prunes stale canonical filenames beforecopying. Reproduced:
Re-running
extract(e.g. with a narrower--category/--typefilter, oragainst a smaller archive) into the same directory silently leaves prior-run
files behind, with no warning and no count discrepancy — a user diffing or
archiving the output directory can mistake stale leftovers for current data.
Nothing in
--help/README/docs states the reuse-vs-replace policy for the threedirectory-writing commands; only
repackhas one. Fix: either document theappend/overwrite-only semantics explicitly, or give
extract(andrender --all) the same non-empty-dir guard behind the existing--forceconvention.2. Broken-pipe panic on truncated stdout
Piping a command's output into a reader that closes early panics:
This is the default Rust SIGPIPE-ignored behaviour; any
dm2 … | head/| lessthat the user quits early prints a panic + backtrace note. Cosmetic but noisy
for a CLI meant to be scripted against. Fix: reset the SIGPIPE disposition to
default at startup, or treat
ErrorKind::BrokenPipeon stdout as a clean exit.