You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reap version prints the version, but reap --version and reap -v fail — the flag isn't registered, so parsing errors and the process exits 2. --version/-v is the first thing many users (and scripts) reach for.
Current behavior
$ reap version
reap 0.4.1 # exit 0
$ reap --version
flag provided but not defined: -version
…usage… # exit 2
reap -v behaves the same.
Expected
reap --version and reap -v print reap <version> and exit 0 — identical to the version subcommand.
Where
cmd/reap/main.go:
flags are registered in run() (the fs.*Var(...) block).
the version subcommand prints reap <version> in the command switch (case "version").
parseInterspersed turns the undefined-flag error into return 2.
Suggested fix
Register a -version/-v bool flag; if set, print reap <version> and return 0 before the subcommand switch. Keep the subcommand too. ~5 lines + a table test — run(args, stdin, stdout, stderr) is already a clean test seam (see the existing cmd/reap tests). stdlib only, no new deps.
Activity
[-]Support `--version` / `-v` flag (only the `version` subcommand works today)[/-][+]Support --version / -v flag[/+]