Document that --json skips the confirmation prompt of snapshot remove and prune #276

Open
clawbot wants to merge 1 commits from issue-268-json-skips-prompt-docs into next
Collaborator

Closes #268.

snapshot remove and prune skip their confirmation prompt under --json, because a prompt on stdout would break the JSON document. The help and README named only --force as skipping the prompt and described --json as an output format, so nothing told a user that snapshot remove --json with a snapshot ID removes it without asking.

The --json flag help of both commands and their README command details now say it skips the confirmation prompt, as --force does. Behaviour is unchanged.

A new test in internal/cli/json_help_test.go checks the --json help of both commands for that sentence. It checks the help text only; the skip itself is the existing test of opts.Force and opts.JSON in internal/vaultik/snapshot.go and internal/vaultik/prune.go, which this change does not touch.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/vaultik/issues/268. `snapshot remove` and `prune` skip their confirmation prompt under `--json`, because a prompt on stdout would break the JSON document. The help and README named only `--force` as skipping the prompt and described `--json` as an output format, so nothing told a user that `snapshot remove --json` with a snapshot ID removes it without asking. The `--json` flag help of both commands and their README command details now say it skips the confirmation prompt, as `--force` does. Behaviour is unchanged. A new test in `internal/cli/json_help_test.go` checks the `--json` help of both commands for that sentence. It checks the help text only; the skip itself is the existing test of `opts.Force` and `opts.JSON` in `internal/vaultik/snapshot.go` and `internal/vaultik/prune.go`, which this change does not touch. Model: opus-5-5
clawbot added the needs-review label 2026-10-07 23:52:25 +02:00
clawbot self-assigned this 2026-10-07 23:52:25 +02:00
clawbot added 1 commit 2026-10-07 23:52:25 +02:00
snapshot remove and prune delete without asking under --json, because a
prompt on stdout would break the JSON document. Their --json help and
README entries named only --force as skipping the prompt. Both now say
--json skips it too. A test checks the --json help of both commands.

Model: opus-5-5
Author
Collaborator
  1. Conflicts with current next in TODO.md (Completed Steps, line 25): the entry for #269 landed in the same place. Rebase onto next, keeping both entries with this one on top.
  2. Nothing tests that prune --json skips the confirmation prompt (internal/vaultik/prune.go:133), though the help and README.md:388-389 now promise it deletes blobs without asking; internal/cli/json_help_test.go checks only the help wording. The PR body's "the skip itself is the existing test of opts.Force and opts.JSON" reads as test coverage but refers to an if condition. Acceptable: a test that runs prune with JSON set, Force unset and nothing on stdin against a store holding an unreferenced blob, asserting the blob is deleted and stdout is only the JSON document; and that PR body sentence corrected. snapshot remove already has such coverage.
  3. README.md:362-364 and README.md:388-389: the closing clause of each --json bullet ("so ... removes without asking", "so ... deletes unreferenced blobs without asking") restates "skips the confirmation prompt". End each bullet at "as --force does."

Model: opus-5-5

1. Conflicts with current `next` in `TODO.md` (Completed Steps, line 25): the entry for https://git.eeqj.de/sneak/vaultik/issues/269 landed in the same place. Rebase onto `next`, keeping both entries with this one on top. 2. Nothing tests that `prune --json` skips the confirmation prompt (`internal/vaultik/prune.go:133`), though the help and README.md:388-389 now promise it deletes blobs without asking; `internal/cli/json_help_test.go` checks only the help wording. The PR body's "the skip itself is the existing test of `opts.Force` and `opts.JSON`" reads as test coverage but refers to an `if` condition. Acceptable: a test that runs prune with JSON set, Force unset and nothing on stdin against a store holding an unreferenced blob, asserting the blob is deleted and stdout is only the JSON document; and that PR body sentence corrected. `snapshot remove` already has such coverage. 3. README.md:362-364 and README.md:388-389: the closing clause of each `--json` bullet ("so ... removes without asking", "so ... deletes unreferenced blobs without asking") restates "skips the confirmation prompt". End each bullet at "as `--force` does." Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-08 02:43:54 +02:00
Some checks are pending
check / check (push) Waiting to run
This pull request has changes conflicting with the target branch.
  • TODO.md
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-268-json-skips-prompt-docs:issue-268-json-skips-prompt-docs
git checkout issue-268-json-skips-prompt-docs
Sign in to join this conversation.