From 0361d1b8694ee0487a6e070b93d72de470a9d742 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Sat, 11 Jan 2025 11:57:16 -0600 Subject: [PATCH] Add the --silent option to allow suppressing log output. --- src/pit.nim | 3 +++ src/pit/cliconstants.nim | 2 ++ src/pit/sync_pbm_vsb.nim | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pit.nim b/src/pit.nim index a60bc30..7c14dca 100644 --- a/src/pit.nim +++ b/src/pit.nim @@ -67,6 +67,9 @@ when isMainModule: if args["--debug"]: consoleLogger.levelThreshold = lvlDebug + if args["--silent"]: + consoleLogger.levelThreshold = lvlNone + if args["--echo-args"]: stderr.writeLine($args) if args["help"]: diff --git a/src/pit/cliconstants.nim b/src/pit/cliconstants.nim index 7251c50..e61aee7 100644 --- a/src/pit/cliconstants.nim +++ b/src/pit/cliconstants.nim @@ -82,6 +82,8 @@ Options: --dry-run Currently only supported by the `sync` command: only print the changes that would be made, but do not actually make them. + + -s, --silent Suppress all logging and status output. """ const ONLINE_HELP* = """Issue States: diff --git a/src/pit/sync_pbm_vsb.nim b/src/pit/sync_pbm_vsb.nim index 17eb8f9..905cbdd 100644 --- a/src/pit/sync_pbm_vsb.nim +++ b/src/pit/sync_pbm_vsb.nim @@ -117,7 +117,6 @@ proc sync*( dryRun = true, batchSize = 100): void = - if not dryRun: echo "NOT DRY RUN" # We're going to do a uni-directional sync, pushing local issues to the # server. However, we only want to update issues that have changed since # the last sync based on the *last-updated* property.