From d7c9f453b9dce3f8561f838c3b8fe66a1f3eeda0 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Fri, 23 Aug 2024 14:55:57 +0800 Subject: [PATCH] Fix: always dry run --- src/chsrc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/chsrc.c b/src/chsrc.c index 2567b5f..e099a3b 100644 --- a/src/chsrc.c +++ b/src/chsrc.c @@ -620,9 +620,14 @@ main (int argc, char const *argv[]) bool matched = false; - char *dry_msg = CliOpt_InEnglish ? "** Enable [Dry Run] mode. Simulate the source changing process (skipping speed measurement). Commands only print but don't run **\n" - : "**开启Dry Run模式,模拟换源过程(跳过测速),命令仅打印并不运行**\n"; - chsrc_log (bdyellow(dry_msg)); + if (CliOpt_DryRun) + { + char *dry_msg = CliOpt_InEnglish ? "** Enable [Dry Run] mode. " \ + "Simulate the source changing process (skipping speed measurement). " \ + "Commands only print but don't run **\n" + : "**开启Dry Run模式,模拟换源过程(跳过测速),命令仅打印并不运行**\n"; + chsrc_log (bdyellow(dry_msg)); + } /* chsrc help */ if (xy_streql (command, "h")