From ec43c09caf11808b808c6046617dc310d649046d Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Mon, 6 Oct 2025 18:22:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E4=B8=A4=E7=A7=8D=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chsrc-main.c | 39 +++++++++++++++++++++++++++++++++++++-- src/framework/core.c | 2 +- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 90abab4..4ba82f7 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -337,6 +337,41 @@ cli_print_target_features (Target_t *target, const char *input_target_name) } +/** + * @brief 简略打印维护信息 + * + * 用于 chsrc get/set/reset + */ +void +cli_print_target_maintain_info_briefly (Target_t *target, const char *input_target_name) +{ + if (target->sources_last_updated) + { + char *msg = ENGLISH ? "Ingredient(Sources) Last Updated: " : "食源检查: "; + printf ("%s%s ", msg, purple(target->sources_last_updated)); + } + + if (target->last_updated) + { + char *msg = ENGLISH ? "Recipe Last Updated: " : "食谱更新: "; + printf ("%s%s ", msg, purple(target->last_updated)); + } + + char num[32]; sprintf(num, "%d", target->cooks_n + target->sauciers_n); + char *msg = ENGLISH ? "Contributors: " : "后厨人数: "; + printf ("%s%s ", msg, purple(num)); + + msg = ENGLISH ? xy_strcat (3, "(See chsrc ls ", input_target_name, ")") + : xy_strcat (3, "(详查 chsrc ls ", input_target_name, ")"); + printf ("%s\n", msg); +} + + +/** + * @brief 详细打印维护信息 + * + * 用于 chsrc ls + */ void cli_print_target_maintain_info (Target_t *target, const char *input_target_name) { @@ -640,10 +675,10 @@ get_target (const char *input, TargetOp code, char *option) return true; } + /* 简短显示维护信息 */ if (TargetOp_Get_Source==code || TargetOp_Set_Source==code || TargetOp_Reset_Source==code) { - br(); - cli_print_target_maintain_info (target, input); + cli_print_target_maintain_info_briefly (target, input); } if (TargetOp_Set_Source==code || TargetOp_Measure_Source==code) diff --git a/src/framework/core.c b/src/framework/core.c index 49f5c8c..ff247c6 100644 --- a/src/framework/core.c +++ b/src/framework/core.c @@ -1144,7 +1144,7 @@ chsrc_determine_chgtype (ChgType_t type) #define MSG_EN_STILL "Still need to operate manually according to the above prompts. " #define MSG_CN_STILL "仍需按上述提示手工操作" -#define thank_mirror(msg) chsrc_log(xy_2strcat(msg,purple(ENGLISH?source->mirror->abbr:source->mirror->name))) +#define thank_mirror(msg) say(xy_2strcat(msg,purple(ENGLISH?source->mirror->abbr:source->mirror->name))) /** * @param source 可为NULL