Skip to content

Commit d7c9f45

Browse files
committed
Fix: always dry run
1 parent 6097792 commit d7c9f45

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/chsrc.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,14 @@ main (int argc, char const *argv[])
620620

621621
bool matched = false;
622622

623-
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"
624-
: "**开启Dry Run模式,模拟换源过程(跳过测速),命令仅打印并不运行**\n";
625-
chsrc_log (bdyellow(dry_msg));
623+
if (CliOpt_DryRun)
624+
{
625+
char *dry_msg = CliOpt_InEnglish ? "** Enable [Dry Run] mode. " \
626+
"Simulate the source changing process (skipping speed measurement). " \
627+
"Commands only print but don't run **\n"
628+
: "**开启Dry Run模式,模拟换源过程(跳过测速),命令仅打印并不运行**\n";
629+
chsrc_log (bdyellow(dry_msg));
630+
}
626631

627632
/* chsrc help */
628633
if (xy_streql (command, "h")

0 commit comments

Comments
 (0)