diff options
| author | tsne <tsne.dev@outlook.com> | 2026-07-06 16:52:20 +0200 |
|---|---|---|
| committer | tsne <tsne.dev@outlook.com> | 2026-07-06 21:37:42 +0200 |
| commit | 84da43998f7cc42cc72652333ac6e3d293abb23e (patch) | |
| tree | 6610f82df854ae86f7f34152bb05fc712ef6f314 /internal/cli/log.go | |
| download | hopper-84da43998f7cc42cc72652333ac6e3d293abb23e.tar.gz | |
Diffstat (limited to 'internal/cli/log.go')
| -rw-r--r-- | internal/cli/log.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/cli/log.go b/internal/cli/log.go new file mode 100644 index 0000000..c837649 --- /dev/null +++ b/internal/cli/log.go @@ -0,0 +1,22 @@ +package cli + +import ( + "tsne.dev/hopper/internal/log" +) + +// logAction prints a per-action line. +// In dry-run mode the line is prefixed with "[dryrun] ". +func logAction(format string, args ...any) { + if dryRun { + format = "[dryrun] " + format + } + log.Print(format, args...) +} + +// logSummary prints the final summary line. +func logSummary(format string, args ...any) { + if dryRun { + format += "\n\nNote: This was a dry run. Nothing on the zone was modified." + } + log.PrintImportant(format, args...) +} |