mirror of
https://github.com/gopasspw/gopass.git
synced 2026-05-30 11:18:48 +02:00
23dae78b13
Addresses I-2 from the code quality audit: make gopass's exit codes
discoverable and stable for scripting users.
Changes:
- internal/action/exit/errors.go: replace iota with explicit integer
constants so that inserting future codes cannot silently renumber
existing ones; add PrintExitCodes(io.Writer) that renders a
tab-aligned table of all 22 codes.
- main.go: add --exit-codes app-level flag; a Before hook calls
PrintExitCodes and exits 0 when the flag is present.
- docs/exit-codes.md: new reference page with the full table and
per-command breakdowns for show, insert, generate, find, delete,
audit, fsck, and doctor.
- docs/commands/{show,insert,generate,find,delete,audit,fsck}.md:
each gets a short '## Exit codes' section pointing at the reference
page.
- ARCHITECTURE.md: expand the exit-package paragraph with a pointer
to the docs and the stable-contract guarantee.
- tests/exitcodes_test.go: integration test asserting gopass
--exit-codes exits 0 and prints representative codes/names.
- main_test.go: fix pre-existing count assertion (42→43, doctor was
added in an earlier commit) and add .audit to commandsWithError
(audit now returns an error when weak passwords are found, as fixed
in B-7).
957 B
957 B
delete command
The delete command is used to remove a single secret or a whole subtree.
Note: Recursive operations crossing mount points are intentionally not supported.
Synopsis
$ gopass delete entry
$ gopass rm -r path/to/folder
$ gopass rm -f entry
$ gopass delete entry key
Modes of operation
- Delete a single secret
- Delete a single key from an existing secret
- Delete a directoy of secrets
Flags
| Flag | Aliases | Description |
|---|---|---|
--recursive |
-r |
Recursively delete files and folders. |
--force |
-f |
Do not ask for confirmation. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Secret deleted successfully |
| 10 | Secret not found |
See docs/exit-codes.md for the full table.
Details
- Removing a single key will need to decrypt the secret