From 659359fbdabb9dfb02fec659cceba88f02c7e8fb Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Sun, 22 Feb 2026 21:20:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5=20`-scope=3D`=20=E9=80=89?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E5=BC=83=E7=94=A8=20`-local`=20=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chsrc-main.c | 39 +++++++++++++++++++++++++++++++++++++++ src/framework/version.h | 8 ++++---- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 4f27959..0f696cc 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -745,6 +745,45 @@ main (int argc, char const *argv[]) else if (xy_streql (argv[i], "-local")) { ProgMode.LocalMode = true; + char *msg = CHINESE ? " -local 选项已弃用,请使用 -scope=project" + : " -local is deprecated, please use -scope=project"; + chsrc_error (msg); + return Exit_Unsupported; + } + else if (xy_str_start_with (argv[i], "-scope=")) + { + const char *scope = argv[i] + 7; + if (xy_streql_ic (scope, "project")) + { + ProgMode.Scope = ProjectScope; + ProgMode.LocalMode = true; /* 迁移过程中,暂时使用原有的 LocalMode 来实现 */ + } + else if (xy_streql_ic (scope, "user")) + { + ProgMode.Scope = UserScope; + } + else if (xy_streql_ic (scope, "system")) + { + ProgMode.Scope = SystemScope; + } + else if (xy_streql_ic (scope, "default")) + { + ProgMode.Scope = DefaultScope; + } + else + { + if (ENGLISH) + { + char *msg = "Unknown scope: "; + chsrc_error (xy_strcat (3, msg, scope, ". Valid scopes are: default, project, user, system")); + } + else + { + char *msg = "未知的换源作用域: "; + chsrc_error (xy_strcat (4, msg, scope, "。", "有效的换源作用域为: default, project, user, system")); + } + return Exit_Unknown; + } } else if (xy_streql (argv[i], "-en") || xy_streql (argv[i], "-english")) { diff --git a/src/framework/version.h b/src/framework/version.h index e3f7755..2aba382 100644 --- a/src/framework/version.h +++ b/src/framework/version.h @@ -12,12 +12,12 @@ * 发布新版本前请修改此文件 * ------------------------------------------------------------*/ -#define Chsrc_Version "0.2.4.2" +#define Chsrc_Version "0.2.5-dev1" // 以下四个宏仅用于 resource/chsrc.rc #define Chsrc_Version_Major 0 #define Chsrc_Version_Minor 2 -#define Chsrc_Version_Patch 4 -#define Chsrc_Version_Pre 2 +#define Chsrc_Version_Patch 5 +#define Chsrc_Version_Pre 0 -#define Chsrc_Release_Date "2026/01/21" +#define Chsrc_Release_Date "2026/02/22"