Print --version to stdout (closes #15)
check / check (push) Successful in 1m18s

Cobra's built-in version flag prints through the writer that carries
help and usage, which is stderr here. The root command now defines
its own -v/--version flag and prints one line, "sfdupes VERSION", to
stdout; a failed write is a fatal error (exit 1). Help and usage stay
on stderr. README documents --version and --help, their streams and
exit codes. Tests cover both flags and the failed write.

Model: opus-5-5
This commit is contained in:
2026-10-04 05:48:05 +00:00
parent 33cf3dd29a
commit 0fb7931ed2
4 changed files with 103 additions and 36 deletions
+3
View File
@@ -29,6 +29,9 @@
# Completed Steps
- `--version` prints `sfdupes VERSION` to stdout; README documents it and
`--help` (2026-10-04, https://git.eeqj.de/sneak/sfdupes/issues/15)
- `report` and `trees` stream the records instead of holding them all in
memory; the schema gains the `files_signature` index (2026-10-04,
https://git.eeqj.de/sneak/sfdupes/issues/14)