From 2d352c39816aa0aba11c7852f298201a3af3fe61 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Fri, 9 Aug 2024 01:49:14 +0800 Subject: [PATCH] Rename cli option macros --- include/chsrc.h | 8 ++++---- src/chsrc.c | 12 ++++++------ src/recipe/lang/python.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/chsrc.h b/include/chsrc.h index 44b3886..9fe98b4 100644 --- a/include/chsrc.h +++ b/include/chsrc.h @@ -89,9 +89,9 @@ chsrc_log_cmd_result (bool result, int ret_code) } -bool Cli_Option_IPv6 = false; -bool Cli_Option_Locally = false; -bool Cli_Option_InEnglish = false; +bool CliOpt_IPv6 = false; +bool CliOpt_Locally = false; +bool CliOpt_InEnglish = false; bool CliOpt_DryRun = false; bool @@ -291,7 +291,7 @@ test_speed_url (const char *url) char *ipv6 = ""; // 默认不启用 - if (Cli_Option_IPv6==true) + if (CliOpt_IPv6==true) { ipv6 = "--ipv6"; } diff --git a/src/chsrc.c b/src/chsrc.c index 6e28c93..362c184 100644 --- a/src/chsrc.c +++ b/src/chsrc.c @@ -66,7 +66,7 @@ pl_ruby_setsrc (char *option) chsrc_ensure_program ("bundle"); char *where = " --global "; - if (Cli_Option_Locally==true) + if (CliOpt_Locally==true) { where = " --local "; } @@ -145,7 +145,7 @@ pl_nodejs_setsrc (char *option) char *cmd = NULL; char *where = " "; - if (Cli_Option_Locally==true) + if (CliOpt_Locally==true) { where = " --location project "; } @@ -241,7 +241,7 @@ pl_php_setsrc (char *option) chsrc_confirm_source (&source); char *where = " -g "; - if (Cli_Option_Locally==true) + if (CliOpt_Locally==true) { where = " "; } @@ -2690,15 +2690,15 @@ main (int argc, char const *argv[]) { if (xy_streql (argv[i], "-ipv6")) { - Cli_Option_IPv6 = true; + CliOpt_IPv6 = true; } else if (xy_streql (argv[i], "-local")) { - Cli_Option_Locally = true; + CliOpt_Locally = true; } else if (xy_streql (argv[i], "-en") || xy_streql (argv[i], "-english")) { - Cli_Option_InEnglish = true; + CliOpt_InEnglish = true; } else if (xy_streql (argv[i], "-dry")) { diff --git a/src/recipe/lang/python.c b/src/recipe/lang/python.c index 8cf7ab5..0cefd58 100644 --- a/src/recipe/lang/python.c +++ b/src/recipe/lang/python.c @@ -3,7 +3,7 @@ * ------------------------------------------------------------- * Contributors : Aoran Zeng * Created on : <2023-09-01> - * Last modified : <2024-08-08> + * Last modified : <2024-08-09> * ------------------------------------------------------------*/ @@ -125,7 +125,7 @@ pl_python_setsrc (char *option) if (pdm_exist) { char *where = " --global "; - if (Cli_Option_Locally==true) + if (CliOpt_Locally==true) { where = " --local "; }