Compare commits

1 Commits
Author SHA1 Message Date
sneak 0fb7931ed2 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
2026-10-04 05:48:05 +00:00
+3 -5
View File
@@ -153,11 +153,9 @@ sfdupes --version
```
`sfdupes --version` (or `-v`) prints one line, `sfdupes VERSION`, to
stdout and exits 0, writing nothing to stderr. `VERSION` is stamped in
at build time from `git describe` (the tag or short commit) by
`make build` and the `Dockerfile`, and is `dev` otherwise. `-h` or
`--help`, alone or after a subcommand, prints the help text to stderr
and exits 0, writing nothing to stdout.
stdout and exits 0, writing nothing to stderr. `-h` or `--help`, alone
or after a subcommand, prints the help text to stderr and exits 0,
writing nothing to stdout.
### Database