Remove -parallel

[GitHub #82]
This commit is contained in:
Aoran Zeng 2024-09-29 10:57:41 +08:00
parent b77c7f5390
commit d030f9adb5
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
2 changed files with 6 additions and 27 deletions

View File

@ -7,7 +7,7 @@
* Contributors : Peng Gao <gn3po4g@outlook.com>
* |
* Created On : <2023-08-29>
* Last Modified : <2024-09-13>
* Last Modified : <2024-09-29>
*
* chsrc
* ------------------------------------------------------------*/
@ -33,7 +33,6 @@ bool CliOpt_Locally = false;
bool CliOpt_InEnglish = false;
bool CliOpt_DryRun = false;
bool CliOpt_NoColor = false;
bool CliOpt_Parallel = false;
/**
* -local **
@ -419,10 +418,7 @@ measure_speed_for_url (void *url)
{
char *time_sec = NULL;
if (CliOpt_Parallel)
time_sec = "9";
else
time_sec = "6";
time_sec = "8";
/* 现在我们切换至跳转后的链接来测速,不再使用下述判断
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
measure_msgs[i] = xy_strjoin (3, " - ", msg, " ... ");
printf ("%s", measure_msgs[i]);
if (CliOpt_Parallel)
say (""); /* 并行时直接显示下一测速状态行 */
else
fflush (stdout);
fflush (stdout);
char *url_ = xy_strdup (url);
@ -601,13 +594,7 @@ int
select_mirror_autoly (SourceInfo *sources, size_t size, const char *target_name)
{
{
char *msg = NULL;
if (CliOpt_Parallel)
msg = CliOpt_InEnglish ? "Measuring speed in parallel. We recommend you use the default sequential measure for more referential results"
: "即将并行测速,建议使用默认的顺序测速以获得更具参考意义的结果";
else
msg = CliOpt_InEnglish ? "Measuring speed in sequence" : "顺序测速中";
char *msg = CliOpt_InEnglish ? "Measuring speed in sequence" : "测速中";
xy_log_brkt (App_Name, bdpurple (CliOpt_InEnglish ? "MEASURE" : "测速"), msg);
say ("");

View File

@ -13,13 +13,13 @@
* | Terrasse <terrasse@qq.com>
* |
* Created On : <2023-08-28>
* Last Modified : <2024-09-23>
* Last Modified : <2024-09-29>
*
* chsrc: Change Source
* ------------------------------------------------------------*/
#define Chsrc_Version "0.1.9.Beta1Dev2"
#define Chsrc_Release_Date "2024/09/23"
#define Chsrc_Release_Date "2024/09/29"
#define Chsrc_Banner_Version "v" Chsrc_Version "-" Chsrc_Release_Date
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
#define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc"
@ -139,7 +139,6 @@ Chsrc_Usage[] = {
"选项:",
"-dry Dry Run模拟换源过程命令仅打印并不运行",
"-para(llel) 并行测速 (默认的顺序测速更有参考意义)",
"-local 仅对本项目而非全局换源 (通过ls <target>查看支持情况)",
"-ipv6 使用IPv6测速",
"-en(glish) 使用英文输出",
@ -173,7 +172,6 @@ Chsrc_Usage_English[] = {
"Options:",
"-dry Dry Run. Simulate the source changing process, command only prints, not run",
"-para(llel) Measure velocity in parallel",
"-local Change source only for this project rather than globally (Via `ls <target>`)",
"-ipv6 Speed measurement using IPv6",
"-en(glish) Output in English",
@ -620,12 +618,6 @@ main (int argc, char const *argv[])
{
CliOpt_DryRun = true;
}
else if ( xy_streql (argv[i], "-para")
|| xy_streql (argv[i], "-parallel")
|| xy_streql (argv[i], "-paralel"))
{
CliOpt_Parallel = true;
}
else if (xy_streql (argv[i], "-no-color") || xy_streql (argv[i], "-no-colour"))
{
CliOpt_NoColor = true;