Skip to content

Commit ec43c09

Browse files
committed
使用两种维护信息展示方式
1 parent cc85521 commit ec43c09

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

src/chsrc-main.c

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,41 @@ cli_print_target_features (Target_t *target, const char *input_target_name)
337337
}
338338

339339

340+
/**
341+
* @brief 简略打印维护信息
342+
*
343+
* 用于 chsrc get/set/reset <target>
344+
*/
345+
void
346+
cli_print_target_maintain_info_briefly (Target_t *target, const char *input_target_name)
347+
{
348+
if (target->sources_last_updated)
349+
{
350+
char *msg = ENGLISH ? "Ingredient(Sources) Last Updated: " : "食源检查: ";
351+
printf ("%s%s ", msg, purple(target->sources_last_updated));
352+
}
353+
354+
if (target->last_updated)
355+
{
356+
char *msg = ENGLISH ? "Recipe Last Updated: " : "食谱更新: ";
357+
printf ("%s%s ", msg, purple(target->last_updated));
358+
}
359+
360+
char num[32]; sprintf(num, "%d", target->cooks_n + target->sauciers_n);
361+
char *msg = ENGLISH ? "Contributors: " : "后厨人数: ";
362+
printf ("%s%s ", msg, purple(num));
363+
364+
msg = ENGLISH ? xy_strcat (3, "(See chsrc ls ", input_target_name, ")")
365+
: xy_strcat (3, "(详查 chsrc ls ", input_target_name, ")");
366+
printf ("%s\n", msg);
367+
}
368+
369+
370+
/**
371+
* @brief 详细打印维护信息
372+
*
373+
* 用于 chsrc ls <target>
374+
*/
340375
void
341376
cli_print_target_maintain_info (Target_t *target, const char *input_target_name)
342377
{
@@ -640,10 +675,10 @@ get_target (const char *input, TargetOp code, char *option)
640675
return true;
641676
}
642677

678+
/* 简短显示维护信息 */
643679
if (TargetOp_Get_Source==code || TargetOp_Set_Source==code || TargetOp_Reset_Source==code)
644680
{
645-
br();
646-
cli_print_target_maintain_info (target, input);
681+
cli_print_target_maintain_info_briefly (target, input);
647682
}
648683

649684
if (TargetOp_Set_Source==code || TargetOp_Measure_Source==code)

src/framework/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ chsrc_determine_chgtype (ChgType_t type)
11441144
#define MSG_EN_STILL "Still need to operate manually according to the above prompts. "
11451145
#define MSG_CN_STILL "仍需按上述提示手工操作"
11461146

1147-
#define thank_mirror(msg) chsrc_log(xy_2strcat(msg,purple(ENGLISH?source->mirror->abbr:source->mirror->name)))
1147+
#define thank_mirror(msg) say(xy_2strcat(msg,purple(ENGLISH?source->mirror->abbr:source->mirror->name)))
11481148

11491149
/**
11501150
* @param source 可为NULL

0 commit comments

Comments
 (0)