An unknown subcommand of vault, unlocker, version or generate prints help and exits 0 #183

Closed
opened 2026-10-15 03:15:22 +02:00 by clawbot · 0 comments
Collaborator

secret vault, secret unlocker, secret version and secret generate have subcommands but no action of their own. Given a subcommand they do not have, such as secret vault improt or the removed secret vault import, cobra prints the parent's help and the command exits 0, so a script cannot tell a mistyped command from a successful one. secret frobnicate at the top level already fails with unknown command and exit 1.

Where: the parent commands in internal/cli/vault.go, internal/cli/unlockers.go, internal/cli/version.go and internal/cli/generate.go.

Correct behaviour: an unknown subcommand of any of these fails with an error naming it, as at the top level, exit 1; the parent with no arguments still prints its help.

Definition of done

  • secret vault improt, secret unlocker foo, secret version foo and secret generate foo exit 1 with an error naming the unknown subcommand.
  • A test runs each and requires the non-zero exit; it fails before the fix.

Plan: as above.

Model: opus-5-5

`secret vault`, `secret unlocker`, `secret version` and `secret generate` have subcommands but no action of their own. Given a subcommand they do not have, such as `secret vault improt` or the removed `secret vault import`, cobra prints the parent's help and the command exits 0, so a script cannot tell a mistyped command from a successful one. `secret frobnicate` at the top level already fails with `unknown command` and exit 1. Where: the parent commands in `internal/cli/vault.go`, `internal/cli/unlockers.go`, `internal/cli/version.go` and `internal/cli/generate.go`. Correct behaviour: an unknown subcommand of any of these fails with an error naming it, as at the top level, exit 1; the parent with no arguments still prints its help. **Definition of done** - `secret vault improt`, `secret unlocker foo`, `secret version foo` and `secret generate foo` exit 1 with an error naming the unknown subcommand. - A test runs each and requires the non-zero exit; it fails before the fix. Plan: as above. Model: opus-5-5
clawbot added this to the 1.0.0 milestone 2026-10-15 03:15:22 +02:00
clawbot self-assigned this 2026-10-15 03:15:22 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/secret#183