@@ -185,39 +185,48 @@ R"(名称:
185185
186186
187187static const char *
188- Chsrc_Usage_English [] = {
189- "Usage: chsrc <command> [options] [target] [mirror]" ,
190- "help Print this help, or h, -h, --help" ,
191- "issue See related issues\n" ,
188+ USAGE_ENGLISH =
189+ R "(NAME:
190+ chsrc - Change Source - (GPLv3 + ) - Developed by RubyMetric
191+
192+ VERSION :
193+ @ver @
192194
193- "list (or ls, or l) List available mirror sites and supported targets" ,
194- "list mirror/target List available mirror sites or supported targets" ,
195- "list os/lang/ware List supported OS/Programming Language/Software\n" ,
195+ USAGE :
196+ chsrc < command > [options ] [target ] [mirror ]
196197
197- "measure <target> Measure velocity of all sources of <target>" ,
198- "cesu <target> \n" ,
198+ COMMANDS :
199+ help , h Print this help , or - h , -- help
200+ issue See related issues
199201
200- "list <target> View available sources and supporting features for <target>" ,
201- "get <target> View the current source state for <target>\n" ,
202+ list , ls , l List available mirror sites and supported targets
203+ list mirror |target List supported : mirror sites /supported targets
204+ list os |lang |ware List supported : OSes /Programming Languages /Softwares
205+ list < target > View available sources and supporting features for < target >
202206
203- "set <target> Change source, select the fastest source by automatic speed measurement" ,
204- "set <target> first Change source, select the fastest source measured by the maintainers team" ,
205- "set <target> <mirror> Change source, specify a mirror site (Via `list <target>`)" ,
206- "set <target> https://url Change source, using user-defined source URL" ,
207- "reset <target> Reset source to the upstream's default\n" ,
207+ measure , m , cesu < target > Measure velocity of all sources of < target >
208208
209- "Options:" ,
210- "-dry Dry Run. Simulate the source changing process, command only prints, not run" ,
211- "-local Change source only for this project rather than globally (Via `ls <target>`)" ,
212- "-ipv6 Speed measurement using IPv6" ,
213- "-en(glish) Output in English" ,
214- "-no-color Output without color\n" ,
209+ get , g < target > View the current source state for < target >
215210
216- "Mirror status: <https://github.com/RubyMetric/chsrc/wiki>" ,
217- "Maintain: <" Chsrc_Maintain_URL ">\n" ,
211+ set , s < target > Change source , select the fastest source by automatic speed measurement
212+ set < target > first Change source , select the fastest source measured by the maintainers team
213+ set < target > < mirror > Change source , specify a mirror site (Via `list < target > `)
214+ set < target > < URL > Change source , using user - defined source URL
215+ reset < target > Reset source to the upstream 's default
218216
219- "We sincerely invite you to become a Chef or Taster to ensure the quality of recipes you are familiar with for users: <https://github.com/RubyMetric/chsrc/issues/130>"
220- };
217+ OPTIONS :
218+ - dry Dry Run . Simulate the source changing process , command only prints , not run
219+ - local Change source only for this project rather than globally (Via `ls < target > `)
220+ - ipv6 Speed measurement using IPv6
221+ - en (glish ) Output in English
222+ - no - color Output without color
223+
224+ MAINTAIN :
225+ We invite you to become a Chef to ensure the quality of recipes you are familiar with for users :
226+
227+ Source Code : < @url @> ,
228+ Become a Maintainer : < https ://github.com/RubyMetric/chsrc/issues/130>
229+ )";
221230
222231
223232
@@ -433,19 +442,14 @@ cli_print_help ()
433442{
434443 char * version_string = purple ("v" Chsrc_Version "-" Chsrc_Release_Date );
435444
436- if (ENGLISH )
437- {
438- for (int i = 0 ; i < xy_arylen (Chsrc_Usage_English ); i ++ )
439- say (Chsrc_Usage_English [i ]);
440- }
441- else
442- {
443- char * str = xy_str_gsub (USAGE_CHINESE , "@ver@" , version_string );
444- str = xy_str_gsub (str , "@url@" , Chsrc_Maintain_URL );
445- println (str );
446- }
445+ const char * raw = CHINESE ? USAGE_CHINESE : USAGE_ENGLISH ;
446+
447+ char * str = xy_str_gsub (raw , "@ver@" , version_string );
448+ str = xy_str_gsub (str , "@url@" , Chsrc_Maintain_URL );
449+ println (str );
447450}
448451
452+
449453void
450454cli_print_issues ()
451455{
0 commit comments