Correct what --cron actually suppresses (closes #84)
All checks were successful
check / check (push) Successful in 6s

The Vaultik.UI doc comment claimed the cli layer replaces the writer with
a discarding writer in --cron mode. It does not. UI is built once as
ui.New(os.Stdout) and never reassigned; internal/cli/app.go calls
UI.SetQuiet(true) when --cron or --quiet is set, which drops Begin,
Complete, Info, Notice, Detail, Progress and Banner - but Warningf and
Errorf have no quiet check and are still emitted.

That distinction matters: the end-of-run summary is deliberately routed
through UI.Warningf so cron delivers something, so a reader who believed
the comment would have concluded the opposite of how the code is meant to
work.

The README's --cron description carried the same imprecision ("Silent
unless error") and is corrected alongside it.

Comment and documentation only - the Go diff contains no non-comment
lines, so there is no behavior change.
This commit was merged in pull request #86.
This commit is contained in:
2026-08-09 07:43:45 +02:00
parent 50e20b460e
commit 3bcdbcfd83
3 changed files with 18 additions and 4 deletions

View File

@@ -49,9 +49,12 @@ type Vaultik struct {
Stdin io.Reader
// UI is the writer for user-facing status, progress, warnings, errors.
// See package internal/ui for formatting conventions. Defaults to a
// writer wrapping Stdout; the cli layer replaces it with a discarding
// writer in --cron mode.
// See package internal/ui for formatting conventions. It always wraps
// Stdout and is never swapped out; under --cron (and --quiet) the cli
// layer instead calls UI.SetQuiet(true), which drops Begin, Complete,
// Info, Notice, Detail, Progress, and Banner messages. Warning and
// Error are still emitted in that mode, so callers must not assume
// that --cron makes this writer silent.
UI *ui.Writer
// restoreCacheObserver, if non-nil, is invoked once with the