Skip to content

Commit d030f9a

Browse files
committed
Remove -parallel
[GitHub #82]
1 parent b77c7f5 commit d030f9a

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

src/chsrc-framework.h

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Contributors : Peng Gao <[email protected]>
88
* |
99
* Created On : <2023-08-29>
10-
* Last Modified : <2024-09-13>
10+
* Last Modified : <2024-09-29>
1111
*
1212
* chsrc 框架
1313
* ------------------------------------------------------------*/
@@ -33,7 +33,6 @@ bool CliOpt_Locally = false;
3333
bool CliOpt_InEnglish = false;
3434
bool CliOpt_DryRun = false;
3535
bool CliOpt_NoColor = false;
36-
bool CliOpt_Parallel = false;
3736

3837
/**
3938
* -local 的含义是启用 *项目级* 换源
@@ -419,10 +418,7 @@ measure_speed_for_url (void *url)
419418
{
420419
char *time_sec = NULL;
421420

422-
if (CliOpt_Parallel)
423-
time_sec = "9";
424-
else
425-
time_sec = "6";
421+
time_sec = "8";
426422

427423
/* 现在我们切换至跳转后的链接来测速,不再使用下述判断
428424
if (xy_str_start_with(url, "https://registry.npmmirror"))
@@ -575,10 +571,7 @@ measure_speed_for_every_source (SourceInfo sources[], int size, double speed_rec
575571
measure_msgs[i] = xy_strjoin (3, " - ", msg, " ... ");
576572
printf ("%s", measure_msgs[i]);
577573

578-
if (CliOpt_Parallel)
579-
say (""); /* 并行时直接显示下一测速状态行 */
580-
else
581-
fflush (stdout);
574+
fflush (stdout);
582575

583576
char *url_ = xy_strdup (url);
584577

@@ -601,13 +594,7 @@ int
601594
select_mirror_autoly (SourceInfo *sources, size_t size, const char *target_name)
602595
{
603596
{
604-
char *msg = NULL;
605-
606-
if (CliOpt_Parallel)
607-
msg = CliOpt_InEnglish ? "Measuring speed in parallel. We recommend you use the default sequential measure for more referential results"
608-
: "即将并行测速,建议使用默认的顺序测速以获得更具参考意义的结果";
609-
else
610-
msg = CliOpt_InEnglish ? "Measuring speed in sequence" : "顺序测速中";
597+
char *msg = CliOpt_InEnglish ? "Measuring speed in sequence" : "测速中";
611598

612599
xy_log_brkt (App_Name, bdpurple (CliOpt_InEnglish ? "MEASURE" : "测速"), msg);
613600
say ("");

src/chsrc-main.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
* | Terrasse <[email protected]>
1414
* |
1515
* Created On : <2023-08-28>
16-
* Last Modified : <2024-09-23>
16+
* Last Modified : <2024-09-29>
1717
*
1818
* chsrc: Change Source —— 全平台通用命令行换源工具
1919
* ------------------------------------------------------------*/
2020

2121
#define Chsrc_Version "0.1.9.Beta1Dev2"
22-
#define Chsrc_Release_Date "2024/09/23"
22+
#define Chsrc_Release_Date "2024/09/29"
2323
#define Chsrc_Banner_Version "v" Chsrc_Version "-" Chsrc_Release_Date
2424
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
2525
#define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc"
@@ -139,7 +139,6 @@ Chsrc_Usage[] = {
139139

140140
"选项:",
141141
"-dry Dry Run,模拟换源过程,命令仅打印并不运行",
142-
"-para(llel) 并行测速 (默认的顺序测速更有参考意义)",
143142
"-local 仅对本项目而非全局换源 (通过ls <target>查看支持情况)",
144143
"-ipv6 使用IPv6测速",
145144
"-en(glish) 使用英文输出",
@@ -173,7 +172,6 @@ Chsrc_Usage_English[] = {
173172

174173
"Options:",
175174
"-dry Dry Run. Simulate the source changing process, command only prints, not run",
176-
"-para(llel) Measure velocity in parallel",
177175
"-local Change source only for this project rather than globally (Via `ls <target>`)",
178176
"-ipv6 Speed measurement using IPv6",
179177
"-en(glish) Output in English",
@@ -620,12 +618,6 @@ main (int argc, char const *argv[])
620618
{
621619
CliOpt_DryRun = true;
622620
}
623-
else if ( xy_streql (argv[i], "-para")
624-
|| xy_streql (argv[i], "-parallel")
625-
|| xy_streql (argv[i], "-paralel"))
626-
{
627-
CliOpt_Parallel = true;
628-
}
629621
else if (xy_streql (argv[i], "-no-color") || xy_streql (argv[i], "-no-colour"))
630622
{
631623
CliOpt_NoColor = true;

0 commit comments

Comments
 (0)