mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-18 09:54:15 +08:00
Add Dry Run mode
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
* | BlockLune <blocklune@gmail.com>
|
||||
* |
|
||||
* Created on : <2023-08-28>
|
||||
* Last modified : <2024-08-08>
|
||||
* Last modified : <2024-08-09>
|
||||
*
|
||||
* chsrc: Change Source —— 全平台通用命令行换源工具
|
||||
* ------------------------------------------------------------*/
|
||||
@@ -2410,6 +2410,7 @@ Chsrc_Usage[] = {
|
||||
"reset <target> 重置,使用上游默认使用的源\n",
|
||||
|
||||
"选项:",
|
||||
"-dry Dry Run,模拟换源过程,命令仅打印并不运行",
|
||||
"-ipv6 使用IPv6测速",
|
||||
"-local 仅对某项目而非全局换源 (通过issue命令查看支持情况)"
|
||||
};
|
||||
@@ -2699,6 +2700,11 @@ main (int argc, char const *argv[])
|
||||
{
|
||||
Cli_Option_InEnglish = true;
|
||||
}
|
||||
else if (xy_streql (argv[i], "-dry"))
|
||||
{
|
||||
CliOpt_DryRun = true;
|
||||
chsrc_log (to_boldyellow ("**开启Dry Run模式,模拟换源过程(跳过测速),命令仅打印并不运行**\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
chsrc_error (xy_2strjoin ("未识别的命令行选项 ", argv[i])); return 1;
|
||||
|
||||
Reference in New Issue
Block a user