Rename enum can status

This commit is contained in:
Aoran Zeng 2024-10-04 02:13:07 +08:00
parent be4f11b1d8
commit d9e6840399
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
22 changed files with 30 additions and 29 deletions

View File

@ -6,9 +6,10 @@
* Contributors : Shengwei Chen <414685209@qq.com> * Contributors : Shengwei Chen <414685209@qq.com>
* | * |
* Created On : <2023-08-29> * Created On : <2023-08-29>
* Last Modified : <2024-10-04>
* Last Modified : <2024-10-09> * Last Modified : <2024-10-09>
* *
* *
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
typedef struct MirrorSite_t { typedef struct MirrorSite_t {
@ -159,10 +160,10 @@ typedef struct SourceInfo_t {
#define def_sources_n(t) const size_t t##_sources_n = xy_arylen(t##_sources) #define def_sources_n(t) const size_t t##_sources_n = xy_arylen(t##_sources)
enum StatusCan { enum Capability {
CanNot, CanNot,
CanFully, FullyCan,
CanSemi PartiallyCan
}; };
/* Target Feature Info */ /* Target Feature Info */
@ -174,7 +175,7 @@ typedef struct FeatInfo_t {
bool can_user_define; // 用户自定义换源URL bool can_user_define; // 用户自定义换源URL
enum StatusCan stcan_locally; enum Capability cap_locally;
char *locally; char *locally;
char *note; char *note;

View File

@ -351,15 +351,15 @@ cli_print_target_features (FeatInfo f, const char *input_target_name)
char *msg = CliOpt_InEnglish ? " Locally: Change source only for this project " : " Locally: 仅对本项目换源 "; char *msg = CliOpt_InEnglish ? " Locally: Change source only for this project " : " Locally: 仅对本项目换源 ";
char *locally_msg = xy_strjoin (3, msg, "| chsrc set -local ", input_target_name); char *locally_msg = xy_strjoin (3, msg, "| chsrc set -local ", input_target_name);
switch (f.stcan_locally) switch (f.cap_locally)
{ {
case CanNot: case CanNot:
printf (" %s%s\n", bdred(NoMark), locally_msg);br(); printf (" %s%s\n", bdred(NoMark), locally_msg);br();
break; break;
case CanFully: case FullyCan:
printf (" %s%s\n", bdgreen(YesMark), purple(locally_msg));br(); printf (" %s%s\n", bdgreen(YesMark), purple(locally_msg));br();
break; break;
case CanSemi: case PartiallyCan:
printf (" %s%s\n\n %s\n", bdgreen(SemiYesMark), purple(locally_msg), f.locally);br(); printf (" %s%s\n\n %s\n", bdgreen(SemiYesMark), purple(locally_msg), f.locally);br();
break; break;
default: default:

View File

@ -97,7 +97,7 @@ pl_dart_flutter_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;

View File

@ -90,7 +90,7 @@ pl_dart_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;

View File

@ -70,7 +70,7 @@ pl_nodejs_bun_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanFully; fi.cap_locally = FullyCan;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -118,7 +118,7 @@ pl_nodejs_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanFully; fi.cap_locally = FullyCan;
fi.locally = "Support npm (chsrc v0.1.7)\nSupport yarn v2 (chsrc v0.1.8.1)\nSupport pnpm (chsrc v0.1.8.2)"; fi.locally = "Support npm (chsrc v0.1.7)\nSupport yarn v2 (chsrc v0.1.8.1)\nSupport pnpm (chsrc v0.1.8.2)";
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -97,7 +97,7 @@ pl_nodejs_yarn_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanFully; fi.cap_locally = FullyCan;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -66,7 +66,7 @@ pl_nodejs_npm_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanFully; fi.cap_locally = FullyCan;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -69,7 +69,7 @@ pl_nodejs_nvm_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.locally = ""; fi.locally = "";
fi.can_english = false; fi.can_english = false;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -67,7 +67,7 @@ pl_nodejs_pnpm_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanFully; fi.cap_locally = FullyCan;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -69,7 +69,7 @@ pl_php_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanFully; fi.cap_locally = FullyCan;
fi.locally = "composer 支持 (From v0.1.7)"; fi.locally = "composer 支持 (From v0.1.7)";
fi.can_english = false; fi.can_english = false;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -69,7 +69,7 @@ pl_python_pdm_feat (char *option)
fi.can_reset = true; fi.can_reset = true;
// PDM 完全支持项目级换源 // PDM 完全支持项目级换源
fi.stcan_locally = CanFully; fi.cap_locally = FullyCan;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;

View File

@ -66,7 +66,7 @@ pl_python_poetry_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanFully; fi.cap_locally = FullyCan;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = false; fi.can_english = false;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -89,7 +89,7 @@ pl_python_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanSemi; fi.cap_locally = PartiallyCan;
fi.locally = "pip 不支持,其他支持"; fi.locally = "pip 不支持,其他支持";
fi.can_english = false; fi.can_english = false;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -79,7 +79,7 @@ pl_python_pip_feat (char *option)
fi.can_reset = true; fi.can_reset = true;
// pip 不支持项目级换源 // pip 不支持项目级换源
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -103,7 +103,7 @@ pl_ruby_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanSemi; fi.cap_locally = PartiallyCan;
fi.locally = "gem 不支持; bundler 支持 (From v0.1.6)"; fi.locally = "gem 不支持; bundler 支持 (From v0.1.6)";
fi.can_english = false; fi.can_english = false;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -78,7 +78,7 @@ pl_rust_cargo_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = true; fi.can_reset = true;
fi.stcan_locally = CanSemi; fi.cap_locally = PartiallyCan;
fi.locally = "可以基于本项目换源吗?请帮助确认"; fi.locally = "可以基于本项目换源吗?请帮助确认";
fi.can_english = false; fi.can_english = false;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -105,7 +105,7 @@ pl_rust_rustup_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.locally = ""; fi.locally = "";
fi.can_english = false; fi.can_english = false;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -66,7 +66,7 @@ os_armbian_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -137,7 +137,7 @@ os_arch_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;
@ -154,7 +154,7 @@ os_archlinuxcn_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.can_english = true; fi.can_english = true;
fi.can_user_define = true; fi.can_user_define = true;

View File

@ -111,7 +111,7 @@ FeatInfo
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanSemi; fi.cap_locally = PartiallyCan;
fi.locally = "具体说明是否支持项目级换源..."; fi.locally = "具体说明是否支持项目级换源...";
fi.can_english = false; fi.can_english = false;
fi.can_user_define = false; fi.can_user_define = false;

View File

@ -102,7 +102,7 @@ wr_homebrew_feat (char *option)
fi.can_get = true; fi.can_get = true;
fi.can_reset = false; fi.can_reset = false;
fi.stcan_locally = CanNot; fi.cap_locally = CanNot;
fi.locally = NULL; fi.locally = NULL;
fi.can_english = true; fi.can_english = true;