From ade48440c867e39006193d3ddd6f9083511c0a15 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Thu, 22 Aug 2024 22:26:26 +0800 Subject: [PATCH] Add English help --- src/chsrc.c | 149 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 104 insertions(+), 45 deletions(-) diff --git a/src/chsrc.c b/src/chsrc.c index fae9349..5e929c0 100644 --- a/src/chsrc.c +++ b/src/chsrc.c @@ -100,11 +100,10 @@ static const char * Chsrc_Usage[] = { - "维护: " Chsrc_Maintain_URL "\n", - "使用: chsrc [options] [target] [mirror]", "help 打印此帮助,或 h, -h, --help", "issue 查看相关issue\n", + "list (或 ls, 或 l) 列出可用镜像源,和可换源目标", "list mirror/target 列出可用镜像源,或可换源目标", "list os/lang/ware 列出可换源的操作系统/编程语言/软件\n", @@ -124,7 +123,41 @@ Chsrc_Usage[] = { "选项:", "-dry Dry Run,模拟换源过程,命令仅打印并不运行", "-ipv6 使用IPv6测速", - "-local 仅对本项目而非全局换源 (通过ls 查看支持情况)" + "-local 仅对本项目而非全局换源 (通过ls 查看支持情况)", + "-en(glish) 使用英文输出\n", + + "维护: <" Chsrc_Maintain_URL ">" +}; + +static const char * +Chsrc_Usage_English[] = { + "Usage: chsrc [options] [target] [mirror]", + "help Print this help, or h, -h, --help", + "issue See related issues\n", + + "list (or ls, or l) List available mirror sites and supported targets", + "list mirror/target List available mirror sites or supported targets", + "list os/lang/ware List supported OS/Programming Language/Software\n", + + "measure Measure velocity of all sources of ", + "cesu \n", + + "list View available sources and supporting features for ", + "get View the current source usage for \n", + + "set Change source, select the fastest source by automatic speed measurement", + "set first Change source, select the fastest source measured by the maintenance team", + "set Change source, specify a mirror site (Via list )", + "set https://url Change source, using user-defined source URL", + "reset Reset source to the upstream's default\n", + + "Options:", + "-dry Dry Run. Simulate the source changing process, command only prints, not run", + "-ipv6 Speed measurement using IPv6", + "-local Change source only for this project rather than globally (Via ls )", + "-en(glish) Output in English\n", + + "Maintain: <" Chsrc_Maintain_URL ">" }; @@ -285,9 +318,16 @@ cli_print_help () say (xy_strjoin (3, "chsrc: Change Source (GPLv3+) ", purple (Chsrc_Banner_Version), " by RubyMetric")); br(); - for (int i=0; i