Silence prune and snapshot removal status under --cron and --quiet (closes #294)
check / check (push) Successful in 13m37s

PruneBlobs, CleanupLocalSnapshots, RemoveSnapshot, RemoveAllSnapshots
and snapshot purge wrote their status lines straight to stdout, so
`snapshot create --cron --prune` printed on every successful run and
--quiet did not silence `prune`, `snapshot purge`, `snapshot remove` or
`remote nuke`. Those lines now go through internal/ui, which drops them
under --cron and --quiet; warnings, errors and --json documents still
print.

The confirmation prompts and their "Cancelled" answer still write to
stdout directly, as the `database delete` prompt does. Under --quiet
without --force, the list of snapshots shown before the purge prompt is
now silenced.

The two purge test fixtures gained the UI writer production always sets.

Model: opus-5-5
This commit is contained in:
2026-10-13 19:43:30 +00:00
parent 5d8c515192
commit cd573def55
7 changed files with 278 additions and 37 deletions
+3 -2
View File
@@ -700,8 +700,9 @@ the `NO_COLOR` environment variable is unset (https://no-color.org/).
reports and tables (`version`, `info`, `remote info`, `snapshot
verify`, `snapshot list`) but never the machine-consumed `config get`
value or the `--json` documents, which a script depends on. The
`database delete` confirmation prompt is also written this way and
always shown: it is an interactive exchange the operator must see.
confirmation prompts of `database delete`, `prune`, `snapshot purge`
and `snapshot remove` are also written this way and always shown:
they are an interactive exchange the operator must see.
`internal/ui` writes to stdout; it is the output the user asked for. The
exceptions are the startup banner and the error a failed command ends