Correct the Vaultik.UI doc comment about --cron (closes #84)
All checks were successful
check / check (pull_request) Successful in 2m59s
All checks were successful
check / check (pull_request) Successful in 2m59s
The field comment claimed the cli layer replaces the UI writer with a
discarding writer in --cron mode. It does not: the writer is created
once as ui.New(os.Stdout) and never reassigned, and setupGlobals calls
UI.SetQuiet(true) instead. Quiet mode drops Begin, Complete, Info,
Notice, Detail, Progress, and Banner, but Warningf and Errorf have no
quiet check and always emit, so --cron does not make the writer silent.
The README's --cron bullet had the adjacent understatement ("Silent
unless error"), and now names warnings as well.
Comments and documentation only; no behavior change.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user