diff --git a/include/source.h b/include/source.h index 147ff70..4c2a157 100644 --- a/include/source.h +++ b/include/source.h @@ -6,9 +6,10 @@ * Contributors : Shengwei Chen <414685209@qq.com> * | * Created On : <2023-08-29> + * Last Modified : <2024-10-04> * Last Modified : <2024-10-09> * - * 镜像站与换源信息 + * 通用镜像站与换源信息 * ------------------------------------------------------------*/ 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) -enum StatusCan { +enum Capability { CanNot, - CanFully, - CanSemi + FullyCan, + PartiallyCan }; /* Target Feature Info */ @@ -174,7 +175,7 @@ typedef struct FeatInfo_t { bool can_user_define; // 用户自定义换源URL - enum StatusCan stcan_locally; + enum Capability cap_locally; char *locally; char *note; diff --git a/src/chsrc-main.c b/src/chsrc-main.c index bb14b0b..1bcab95 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -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 *locally_msg = xy_strjoin (3, msg, "| chsrc set -local ", input_target_name); - switch (f.stcan_locally) + switch (f.cap_locally) { case CanNot: printf (" %s%s\n", bdred(NoMark), locally_msg);br(); break; - case CanFully: + case FullyCan: printf (" %s%s\n", bdgreen(YesMark), purple(locally_msg));br(); break; - case CanSemi: + case PartiallyCan: printf (" %s%s\n\n %s\n", bdgreen(SemiYesMark), purple(locally_msg), f.locally);br(); break; default: diff --git a/src/recipe/lang/Dart/Flutter.c b/src/recipe/lang/Dart/Flutter.c index 1f0d5b0..ce14c7c 100644 --- a/src/recipe/lang/Dart/Flutter.c +++ b/src/recipe/lang/Dart/Flutter.c @@ -97,7 +97,7 @@ pl_dart_flutter_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.locally = NULL; fi.can_english = true; diff --git a/src/recipe/lang/Dart/Pub.c b/src/recipe/lang/Dart/Pub.c index 4836ce9..da05590 100644 --- a/src/recipe/lang/Dart/Pub.c +++ b/src/recipe/lang/Dart/Pub.c @@ -90,7 +90,7 @@ pl_dart_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.locally = NULL; fi.can_english = true; diff --git a/src/recipe/lang/Node.js/Bun.c b/src/recipe/lang/Node.js/Bun.c index 1dbecf8..20e84ac 100644 --- a/src/recipe/lang/Node.js/Bun.c +++ b/src/recipe/lang/Node.js/Bun.c @@ -70,7 +70,7 @@ pl_nodejs_bun_feat (char *option) fi.can_get = true; fi.can_reset = true; - fi.stcan_locally = CanFully; + fi.cap_locally = FullyCan; fi.locally = NULL; fi.can_english = true; fi.can_user_define = true; diff --git a/src/recipe/lang/Node.js/Node.js.c b/src/recipe/lang/Node.js/Node.js.c index ac469cd..6589af3 100644 --- a/src/recipe/lang/Node.js/Node.js.c +++ b/src/recipe/lang/Node.js/Node.js.c @@ -118,7 +118,7 @@ pl_nodejs_feat (char *option) fi.can_get = 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.can_english = true; fi.can_user_define = true; diff --git a/src/recipe/lang/Node.js/Yarn.c b/src/recipe/lang/Node.js/Yarn.c index 49c6249..4d848aa 100644 --- a/src/recipe/lang/Node.js/Yarn.c +++ b/src/recipe/lang/Node.js/Yarn.c @@ -97,7 +97,7 @@ pl_nodejs_yarn_feat (char *option) fi.can_get = true; fi.can_reset = true; - fi.stcan_locally = CanFully; + fi.cap_locally = FullyCan; fi.locally = NULL; fi.can_english = true; fi.can_user_define = true; diff --git a/src/recipe/lang/Node.js/npm.c b/src/recipe/lang/Node.js/npm.c index 3ffcc14..79325f1 100644 --- a/src/recipe/lang/Node.js/npm.c +++ b/src/recipe/lang/Node.js/npm.c @@ -66,7 +66,7 @@ pl_nodejs_npm_feat (char *option) fi.can_get = true; fi.can_reset = true; - fi.stcan_locally = CanFully; + fi.cap_locally = FullyCan; fi.locally = NULL; fi.can_english = true; fi.can_user_define = true; diff --git a/src/recipe/lang/Node.js/nvm.c b/src/recipe/lang/Node.js/nvm.c index fc3959f..a57f17a 100644 --- a/src/recipe/lang/Node.js/nvm.c +++ b/src/recipe/lang/Node.js/nvm.c @@ -69,7 +69,7 @@ pl_nodejs_nvm_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.locally = ""; fi.can_english = false; fi.can_user_define = true; diff --git a/src/recipe/lang/Node.js/pnpm.c b/src/recipe/lang/Node.js/pnpm.c index 4a6401c..f5ac031 100644 --- a/src/recipe/lang/Node.js/pnpm.c +++ b/src/recipe/lang/Node.js/pnpm.c @@ -67,7 +67,7 @@ pl_nodejs_pnpm_feat (char *option) fi.can_get = true; fi.can_reset = true; - fi.stcan_locally = CanFully; + fi.cap_locally = FullyCan; fi.locally = NULL; fi.can_english = true; fi.can_user_define = true; diff --git a/src/recipe/lang/PHP.c b/src/recipe/lang/PHP.c index f5b30ec..f00825c 100644 --- a/src/recipe/lang/PHP.c +++ b/src/recipe/lang/PHP.c @@ -69,7 +69,7 @@ pl_php_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanFully; + fi.cap_locally = FullyCan; fi.locally = "composer 支持 (From v0.1.7)"; fi.can_english = false; fi.can_user_define = true; diff --git a/src/recipe/lang/Python/PDM.c b/src/recipe/lang/Python/PDM.c index 6df25cb..bcac2c9 100644 --- a/src/recipe/lang/Python/PDM.c +++ b/src/recipe/lang/Python/PDM.c @@ -69,7 +69,7 @@ pl_python_pdm_feat (char *option) fi.can_reset = true; // PDM 完全支持项目级换源 - fi.stcan_locally = CanFully; + fi.cap_locally = FullyCan; fi.locally = NULL; fi.can_english = true; diff --git a/src/recipe/lang/Python/Poetry.c b/src/recipe/lang/Python/Poetry.c index f54b0f0..eb7ce99 100644 --- a/src/recipe/lang/Python/Poetry.c +++ b/src/recipe/lang/Python/Poetry.c @@ -66,7 +66,7 @@ pl_python_poetry_feat (char *option) fi.can_get = true; fi.can_reset = true; - fi.stcan_locally = CanFully; + fi.cap_locally = FullyCan; fi.locally = NULL; fi.can_english = false; fi.can_user_define = true; diff --git a/src/recipe/lang/Python/Python.c b/src/recipe/lang/Python/Python.c index e4647ee..4bba6d7 100644 --- a/src/recipe/lang/Python/Python.c +++ b/src/recipe/lang/Python/Python.c @@ -89,7 +89,7 @@ pl_python_feat (char *option) fi.can_get = true; fi.can_reset = true; - fi.stcan_locally = CanSemi; + fi.cap_locally = PartiallyCan; fi.locally = "pip 不支持,其他支持"; fi.can_english = false; fi.can_user_define = true; diff --git a/src/recipe/lang/Python/pip.c b/src/recipe/lang/Python/pip.c index 4512ba2..f711f9d 100644 --- a/src/recipe/lang/Python/pip.c +++ b/src/recipe/lang/Python/pip.c @@ -79,7 +79,7 @@ pl_python_pip_feat (char *option) fi.can_reset = true; // pip 不支持项目级换源 - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.locally = NULL; fi.can_english = true; fi.can_user_define = true; diff --git a/src/recipe/lang/Ruby.c b/src/recipe/lang/Ruby.c index e2a0976..ca1a137 100644 --- a/src/recipe/lang/Ruby.c +++ b/src/recipe/lang/Ruby.c @@ -103,7 +103,7 @@ pl_ruby_feat (char *option) fi.can_get = true; fi.can_reset = true; - fi.stcan_locally = CanSemi; + fi.cap_locally = PartiallyCan; fi.locally = "gem 不支持; bundler 支持 (From v0.1.6)"; fi.can_english = false; fi.can_user_define = true; diff --git a/src/recipe/lang/Rust/Cargo.c b/src/recipe/lang/Rust/Cargo.c index 71ac3a5..57f7e37 100644 --- a/src/recipe/lang/Rust/Cargo.c +++ b/src/recipe/lang/Rust/Cargo.c @@ -78,7 +78,7 @@ pl_rust_cargo_feat (char *option) fi.can_get = true; fi.can_reset = true; - fi.stcan_locally = CanSemi; + fi.cap_locally = PartiallyCan; fi.locally = "可以基于本项目换源吗?请帮助确认"; fi.can_english = false; fi.can_user_define = true; diff --git a/src/recipe/lang/Rust/rustup.c b/src/recipe/lang/Rust/rustup.c index 479d0d1..ff2c510 100644 --- a/src/recipe/lang/Rust/rustup.c +++ b/src/recipe/lang/Rust/rustup.c @@ -105,7 +105,7 @@ pl_rust_rustup_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.locally = ""; fi.can_english = false; fi.can_user_define = true; diff --git a/src/recipe/os/APT/Armbian.c b/src/recipe/os/APT/Armbian.c index 73f341d..93f59f7 100644 --- a/src/recipe/os/APT/Armbian.c +++ b/src/recipe/os/APT/Armbian.c @@ -66,7 +66,7 @@ os_armbian_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.can_english = true; fi.can_user_define = true; diff --git a/src/recipe/os/pacman/Arch-Linux.c b/src/recipe/os/pacman/Arch-Linux.c index 456ad1b..dd5df26 100644 --- a/src/recipe/os/pacman/Arch-Linux.c +++ b/src/recipe/os/pacman/Arch-Linux.c @@ -137,7 +137,7 @@ os_arch_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.can_english = true; fi.can_user_define = true; @@ -154,7 +154,7 @@ os_archlinuxcn_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.can_english = true; fi.can_user_define = true; diff --git a/src/recipe/template.c b/src/recipe/template.c index f7c1bde..db88c53 100644 --- a/src/recipe/template.c +++ b/src/recipe/template.c @@ -111,7 +111,7 @@ FeatInfo fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanSemi; + fi.cap_locally = PartiallyCan; fi.locally = "具体说明是否支持项目级换源..."; fi.can_english = false; fi.can_user_define = false; diff --git a/src/recipe/ware/Homebrew.c b/src/recipe/ware/Homebrew.c index 72cd1b3..f6572c8 100644 --- a/src/recipe/ware/Homebrew.c +++ b/src/recipe/ware/Homebrew.c @@ -102,7 +102,7 @@ wr_homebrew_feat (char *option) fi.can_get = true; fi.can_reset = false; - fi.stcan_locally = CanNot; + fi.cap_locally = CanNot; fi.locally = NULL; fi.can_english = true;