From 31f1f30c3191812ee5a604996ca9e610493c7da3 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Tue, 22 Jul 2025 18:18:04 +0800 Subject: [PATCH] Use `rawstr4c` for usage and `-v` --- src/chsrc-main.c | 111 ++------------------------------ src/rawstr4c.h | 14 ++++ src/rawstr4c.md | 163 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+), 105 deletions(-) create mode 100644 src/rawstr4c.h create mode 100644 src/rawstr4c.md diff --git a/src/chsrc-main.c b/src/chsrc-main.c index cda6aac..0829685 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -139,92 +139,7 @@ #include "recipe/menu.c" - -static const char * -USAGE_CHINESE = -R"(名称: - chsrc - Change Source - (GPLv3+) - Developed by RubyMetric - -版本: - @ver@ - -使用: - chsrc [options] [target] [mirror] - -命令: - help, h 打印此帮助,或 -h, --help - issue 查看相关issue - - list, ls, l 列出可用镜像站和可换源目标 - list mirror|target 列出支持的: 镜像站/换源目标 - list os|lang|ware 列出支持的: 操作系统/编程语言/软件 - list 查看该目标可用源与支持功能 - - measure, m, cesu 对该目标所有源测速 - - get, g 查看该目标当前源的使用情况 - - set, s 换源,自动测速后挑选最快源 - set first 换源,使用维护团队测速第一的源 - set 换源,指定使用某镜像站 (通过list 查看) - set 换源,用户自定义源URL - reset 重置,使用上游默认使用的源 - -选项: - -dry Dry Run,模拟换源过程,命令仅打印并不运行 - -local 仅对本项目而非全局换源 (通过ls 查看支持情况) - -ipv6 使用IPv6测速 - -en(glish) 使用英文输出 - -no-color 无颜色输出 - -维护: - 邀请您担任 Chef, 为用户把关您熟悉的 recipe - 源代码地址: @url@ - 成为维护者: https://github.com/RubyMetric/chsrc/issues/130)"; - - -static const char * -USAGE_ENGLISH = -R"(NAME: - chsrc - Change Source - (GPLv3+) - Developed by RubyMetric - -VERSION: - @ver@ - -USAGE: - chsrc [options] [target] [mirror] - -COMMANDS: - help, h Print this help, or -h, --help - issue See related issues - - list, ls, l List available mirror sites and supported targets - list mirror|target List supported: mirror sites/supported targets - list os|lang|ware List supported: OSes/Programming Languages/Softwares - list View available sources and supporting features for - - measure, m, cesu Measure velocity of all sources of - - get, g View the current source state for - - set, s Change source, select the fastest source by automatic speed measurement - set first Change source, select the fastest source measured by the maintainers team - set Change source, specify a mirror site (Via `list `) - set Change source, using user-defined source URL - reset Reset source to the upstream's default - -OPTIONS: - -dry Dry Run. Simulate the source changing process, command only prints, not run - -local Change source only for this project rather than globally (Via `ls `) - -ipv6 Speed measurement using IPv6 - -en(glish) Output in English - -no-color Output without color - -MAINTAIN: - We invite you to become a Chef to ensure the quality of recipes you are familiar with for users: - - Source Code: @url@, - Become a Maintainer: https://github.com/RubyMetric/chsrc/issues/130)"; +#include "rawstr4c.h" @@ -425,13 +340,8 @@ cli_print_target_features (Feature_t f, const char *input_target_name) void cli_print_version () { - say ("chsrc " Chsrc_Version); - say (R"(Copyright (C) 2025 Aoran Zeng, Heng Guo -License GPLv3+: GNU GPL version 3 or later -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. - -Written by Aoran Zeng, Heng Guo and contributors. (See chsrc-main.c))"); + char *str = xy_str_gsub (RAWSTR_chsrc_for_v, "@ver@", Chsrc_Version); + print (str); } @@ -440,27 +350,18 @@ cli_print_help () { char *version_string = purple("v" Chsrc_Version "-" Chsrc_Release_Date); - const char *raw = CHINESE ? USAGE_CHINESE : USAGE_ENGLISH; + const char *raw = CHINESE ? RAWSTR_chsrc_USAGE_CHINESE : RAWSTR_chsrc_USAGE_ENGLISH; char *str = xy_str_gsub (raw, "@ver@", version_string); str = xy_str_gsub (str, "@url@", Chsrc_Maintain_URL); - println (str); + print (str); } void cli_print_issues () { - say (R"( -We accept issues both sides on Gitee and Github - - - https://gitee.com/RubyMetric/chsrc/issues - - https://github.com/RubyMetric/chsrc/issues - -Latest Mirror site status wiki: - - - https://github.com/RubyMetric/chsrc/wiki -)"); + print (RAWSTR_chsrc_for_issue); /* if (chsrc_check_program ("gh")) diff --git a/src/rawstr4c.h b/src/rawstr4c.h new file mode 100644 index 0000000..62f3bd6 --- /dev/null +++ b/src/rawstr4c.h @@ -0,0 +1,14 @@ +#pragma once + +/** + * Generated by rawstr4c v0.2.3-2025/07/22 + */ + +char RAWSTR_chsrc_USAGE_CHINESE[] = "\345\220\215\347\247\260\072\012\040\040\040\143\150\163\162\143\040\055\040\103\150\141\156\147\145\040\123\157\165\162\143\145\040\055\040\050\107\120\114\166\063\053\051\012\012\347\211\210\346\234\254\072\012\040\040\040\100\166\145\162\100\012\012\344\275\277\347\224\250\072\012\040\040\040\143\150\163\162\143\040\074\143\157\155\155\141\156\144\076\040\133\157\160\164\151\157\156\163\135\040\133\164\141\162\147\145\164\135\040\133\155\151\162\162\157\162\135\012\012\345\221\275\344\273\244\072\012\040\040\040\150\145\154\160\054\040\150\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\346\211\223\345\215\260\346\255\244\345\270\256\345\212\251\357\274\214\346\210\226\040\055\150\054\040\055\055\150\145\154\160\012\040\040\040\151\163\163\165\145\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\346\237\245\347\234\213\347\233\270\345\205\263\151\163\163\165\145\012\012\040\040\040\154\151\163\164\054\040\154\163\054\040\154\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\345\210\227\345\207\272\345\217\257\347\224\250\351\225\234\345\203\217\347\253\231\345\222\214\345\217\257\346\215\242\346\272\220\347\233\256\346\240\207\012\040\040\040\154\151\163\164\040\040\155\151\162\162\157\162\174\164\141\162\147\145\164\040\040\040\040\040\040\040\040\345\210\227\345\207\272\346\224\257\346\214\201\347\232\204\072\040\351\225\234\345\203\217\347\253\231\057\346\215\242\346\272\220\347\233\256\346\240\207\012\040\040\040\154\151\163\164\040\040\157\163\174\154\141\156\147\174\167\141\162\145\040\040\040\040\040\040\040\040\040\345\210\227\345\207\272\346\224\257\346\214\201\347\232\204\072\040\346\223\215\344\275\234\347\263\273\347\273\237\057\347\274\226\347\250\213\350\257\255\350\250\200\057\350\275\257\344\273\266\012\040\040\040\154\151\163\164\040\040\040\074\164\141\162\147\145\164\076\040\040\040\040\040\040\040\040\040\040\040\040\346\237\245\347\234\213\350\257\245\347\233\256\346\240\207\345\217\257\347\224\250\346\272\220\344\270\216\346\224\257\346\214\201\345\212\237\350\203\275\012\012\040\040\040\155\145\141\163\165\162\145\054\040\155\054\040\143\145\163\165\040\074\164\141\162\147\145\164\076\040\040\345\257\271\350\257\245\347\233\256\346\240\207\346\211\200\346\234\211\346\272\220\346\265\213\351\200\237\012\012\040\040\040\147\145\164\054\040\147\040\074\164\141\162\147\145\164\076\040\040\040\040\040\040\040\040\040\040\040\040\346\237\245\347\234\213\350\257\245\347\233\256\346\240\207\345\275\223\345\211\215\346\272\220\347\232\204\344\275\277\347\224\250\346\203\205\345\206\265\012\012\040\040\040\163\145\164\054\040\163\040\074\164\141\162\147\145\164\076\040\040\040\040\040\040\040\040\040\040\040\040\346\215\242\346\272\220\357\274\214\350\207\252\345\212\250\346\265\213\351\200\237\345\220\216\346\214\221\351\200\211\346\234\200\345\277\253\346\272\220\012\040\040\040\163\145\164\040\040\040\040\074\164\141\162\147\145\164\076\040\040\146\151\162\163\164\040\040\040\040\040\346\215\242\346\272\220\357\274\214\344\275\277\347\224\250\347\273\264\346\212\244\345\233\242\351\230\237\346\265\213\351\200\237\347\254\254\344\270\200\347\232\204\346\272\220\012\040\040\040\163\145\164\040\040\040\040\074\164\141\162\147\145\164\076\040\074\155\151\162\162\157\162\076\040\040\040\346\215\242\346\272\220\357\274\214\346\214\207\345\256\232\344\275\277\347\224\250\346\237\220\351\225\234\345\203\217\347\253\231\040\050\351\200\232\350\277\207\154\151\163\164\040\074\164\141\162\147\145\164\076\346\237\245\347\234\213\051\012\040\040\040\163\145\164\040\040\040\040\074\164\141\162\147\145\164\076\040\040\074\125\122\114\076\040\040\040\040\040\346\215\242\346\272\220\357\274\214\347\224\250\346\210\267\350\207\252\345\256\232\344\271\211\346\272\220\125\122\114\012\040\040\040\162\145\163\145\164\040\040\074\164\141\162\147\145\164\076\040\040\040\040\040\040\040\040\040\040\040\040\351\207\215\347\275\256\357\274\214\344\275\277\347\224\250\344\270\212\346\270\270\351\273\230\350\256\244\344\275\277\347\224\250\347\232\204\346\272\220\012\012\351\200\211\351\241\271\072\012\040\040\040\055\144\162\171\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\104\162\171\040\122\165\156\357\274\214\346\250\241\346\213\237\346\215\242\346\272\220\350\277\207\347\250\213\357\274\214\345\221\275\344\273\244\344\273\205\346\211\223\345\215\260\345\271\266\344\270\215\350\277\220\350\241\214\012\040\040\040\055\154\157\143\141\154\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\344\273\205\345\257\271\346\234\254\351\241\271\347\233\256\350\200\214\351\235\236\345\205\250\345\261\200\346\215\242\346\272\220\040\050\351\200\232\350\277\207\154\163\040\074\164\141\162\147\145\164\076\346\237\245\347\234\213\346\224\257\346\214\201\346\203\205\345\206\265\051\012\040\040\040\055\151\160\166\066\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\344\275\277\347\224\250\111\120\166\066\346\265\213\351\200\237\012\040\040\040\055\145\156\050\147\154\151\163\150\051\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\344\275\277\347\224\250\350\213\261\346\226\207\350\276\223\345\207\272\012\040\040\040\055\156\157\055\143\157\154\157\162\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\346\227\240\351\242\234\350\211\262\350\276\223\345\207\272\012\012\347\273\264\346\212\244\072\012\040\040\040\351\202\200\350\257\267\346\202\250\346\213\205\344\273\273\040\103\150\145\146\054\040\344\270\272\347\224\250\346\210\267\346\212\212\345\205\263\346\202\250\347\206\237\346\202\211\347\232\204\040\162\145\143\151\160\145\012\040\040\040\346\272\220\344\273\243\347\240\201\345\234\260\345\235\200\072\040\100\165\162\154\100\012\040\040\040\346\210\220\344\270\272\347\273\264\346\212\244\350\200\205\072\040\150\164\164\160\163\072\057\057\147\151\164\150\165\142\056\143\157\155\057\122\165\142\171\115\145\164\162\151\143\057\143\150\163\162\143\057\151\163\163\165\145\163\057\061\063\060\012"; + +char RAWSTR_chsrc_USAGE_ENGLISH[] = "\116\101\115\105\072\012\040\040\040\143\150\163\162\143\040\055\040\103\150\141\156\147\145\040\123\157\165\162\143\145\040\055\040\050\107\120\114\166\063\053\051\012\012\126\105\122\123\111\117\116\072\012\040\040\040\100\166\145\162\100\012\012\125\123\101\107\105\072\012\040\040\040\143\150\163\162\143\040\074\143\157\155\155\141\156\144\076\040\133\157\160\164\151\157\156\163\135\040\133\164\141\162\147\145\164\135\040\133\155\151\162\162\157\162\135\012\012\103\117\115\115\101\116\104\123\072\012\040\040\040\150\145\154\160\054\040\150\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\120\162\151\156\164\040\164\150\151\163\040\150\145\154\160\054\040\157\162\040\055\150\054\040\055\055\150\145\154\160\012\040\040\040\151\163\163\165\145\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\123\145\145\040\162\145\154\141\164\145\144\040\151\163\163\165\145\163\012\012\040\040\040\154\151\163\164\054\040\154\163\054\040\154\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\114\151\163\164\040\141\166\141\151\154\141\142\154\145\040\155\151\162\162\157\162\040\163\151\164\145\163\040\141\156\144\040\163\165\160\160\157\162\164\145\144\040\164\141\162\147\145\164\163\012\040\040\040\154\151\163\164\040\040\155\151\162\162\157\162\174\164\141\162\147\145\164\040\040\040\040\040\040\040\040\114\151\163\164\040\163\165\160\160\157\162\164\145\144\072\040\040\155\151\162\162\157\162\040\163\151\164\145\163\057\163\165\160\160\157\162\164\145\144\040\164\141\162\147\145\164\163\012\040\040\040\154\151\163\164\040\040\157\163\174\154\141\156\147\174\167\141\162\145\040\040\040\040\040\040\040\040\040\114\151\163\164\040\163\165\160\160\157\162\164\145\144\072\040\117\123\145\163\057\120\162\157\147\162\141\155\155\151\156\147\040\114\141\156\147\165\141\147\145\163\057\123\157\146\164\167\141\162\145\163\012\040\040\040\154\151\163\164\040\040\040\074\164\141\162\147\145\164\076\040\040\040\040\040\040\040\040\040\040\040\040\126\151\145\167\040\141\166\141\151\154\141\142\154\145\040\163\157\165\162\143\145\163\040\141\156\144\040\163\165\160\160\157\162\164\151\156\147\040\146\145\141\164\165\162\145\163\040\146\157\162\040\074\164\141\162\147\145\164\076\012\012\040\040\040\155\145\141\163\165\162\145\054\040\155\054\040\143\145\163\165\040\074\164\141\162\147\145\164\076\040\040\115\145\141\163\165\162\145\040\166\145\154\157\143\151\164\171\040\157\146\040\141\154\154\040\163\157\165\162\143\145\163\040\157\146\040\074\164\141\162\147\145\164\076\012\012\040\040\040\147\145\164\054\040\147\040\074\164\141\162\147\145\164\076\040\040\040\040\040\040\040\040\040\040\040\040\126\151\145\167\040\164\150\145\040\143\165\162\162\145\156\164\040\163\157\165\162\143\145\040\163\164\141\164\145\040\146\157\162\040\074\164\141\162\147\145\164\076\012\012\040\040\040\163\145\164\054\040\163\040\074\164\141\162\147\145\164\076\040\040\040\040\040\040\040\040\040\040\040\040\103\150\141\156\147\145\040\163\157\165\162\143\145\054\040\163\145\154\145\143\164\040\164\150\145\040\146\141\163\164\145\163\164\040\163\157\165\162\143\145\040\142\171\040\141\165\164\157\155\141\164\151\143\040\163\160\145\145\144\040\155\145\141\163\165\162\145\155\145\156\164\012\040\040\040\163\145\164\040\040\040\040\074\164\141\162\147\145\164\076\040\040\146\151\162\163\164\040\040\040\040\040\103\150\141\156\147\145\040\163\157\165\162\143\145\054\040\163\145\154\145\143\164\040\164\150\145\040\146\141\163\164\145\163\164\040\163\157\165\162\143\145\040\155\145\141\163\165\162\145\144\040\142\171\040\164\150\145\040\155\141\151\156\164\141\151\156\145\162\163\040\164\145\141\155\012\040\040\040\163\145\164\040\040\040\040\074\164\141\162\147\145\164\076\040\074\155\151\162\162\157\162\076\040\040\040\103\150\141\156\147\145\040\163\157\165\162\143\145\054\040\163\160\145\143\151\146\171\040\141\040\155\151\162\162\157\162\040\163\151\164\145\040\050\126\151\141\040\140\154\151\163\164\040\074\164\141\162\147\145\164\076\140\051\012\040\040\040\163\145\164\040\040\040\040\074\164\141\162\147\145\164\076\040\040\074\125\122\114\076\040\040\040\040\040\103\150\141\156\147\145\040\163\157\165\162\143\145\054\040\165\163\151\156\147\040\165\163\145\162\055\144\145\146\151\156\145\144\040\163\157\165\162\143\145\040\125\122\114\012\040\040\040\162\145\163\145\164\040\040\074\164\141\162\147\145\164\076\040\040\040\040\040\040\040\040\040\040\040\040\122\145\163\145\164\040\040\163\157\165\162\143\145\040\164\157\040\164\150\145\040\165\160\163\164\162\145\141\155\047\163\040\144\145\146\141\165\154\164\012\012\117\120\124\111\117\116\123\072\012\040\040\040\055\144\162\171\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\104\162\171\040\122\165\156\056\040\123\151\155\165\154\141\164\145\040\164\150\145\040\163\157\165\162\143\145\040\143\150\141\156\147\151\156\147\040\160\162\157\143\145\163\163\054\040\143\157\155\155\141\156\144\040\157\156\154\171\040\160\162\151\156\164\163\054\040\156\157\164\040\162\165\156\012\040\040\040\055\154\157\143\141\154\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\103\150\141\156\147\145\040\163\157\165\162\143\145\040\157\156\154\171\040\146\157\162\040\164\150\151\163\040\160\162\157\152\145\143\164\040\162\141\164\150\145\162\040\164\150\141\156\040\147\154\157\142\141\154\154\171\040\050\126\151\141\040\140\154\163\040\074\164\141\162\147\145\164\076\140\051\012\040\040\040\055\151\160\166\066\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\123\160\145\145\144\040\155\145\141\163\165\162\145\155\145\156\164\040\165\163\151\156\147\040\111\120\166\066\012\040\040\040\055\145\156\050\147\154\151\163\150\051\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\117\165\164\160\165\164\040\151\156\040\105\156\147\154\151\163\150\012\040\040\040\055\156\157\055\143\157\154\157\162\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\117\165\164\160\165\164\040\167\151\164\150\157\165\164\040\143\157\154\157\162\012\012\115\101\111\116\124\101\111\116\072\012\040\040\040\127\145\040\151\156\166\151\164\145\040\171\157\165\040\164\157\040\142\145\143\157\155\145\040\141\040\103\150\145\146\040\164\157\040\145\156\163\165\162\145\040\164\150\145\040\161\165\141\154\151\164\171\040\157\146\040\162\145\143\151\160\145\163\040\171\157\165\040\141\162\145\040\146\141\155\151\154\151\141\162\040\167\151\164\150\040\146\157\162\040\165\163\145\162\163\072\012\012\040\040\040\123\157\165\162\143\145\040\103\157\144\145\072\040\040\040\040\040\040\040\040\040\100\165\162\154\100\054\012\040\040\040\102\145\143\157\155\145\040\141\040\115\141\151\156\164\141\151\156\145\162\072\040\150\164\164\160\163\072\057\057\147\151\164\150\165\142\056\143\157\155\057\122\165\142\171\115\145\164\162\151\143\057\143\150\163\162\143\057\151\163\163\165\145\163\057\061\063\060\012"; + +char RAWSTR_chsrc_for_v[] = "\143\150\163\162\143\040\100\166\145\162\100\012\103\157\160\171\162\151\147\150\164\040\050\103\051\040\062\060\062\065\040\101\157\162\141\156\040\132\145\156\147\054\040\110\145\156\147\040\107\165\157\012\114\151\143\145\156\163\145\040\107\120\114\166\063\053\072\040\107\116\125\040\107\120\114\040\166\145\162\163\151\157\156\040\063\040\157\162\040\154\141\164\145\162\040\074\150\164\164\160\163\072\057\057\147\156\165\056\157\162\147\057\154\151\143\145\156\163\145\163\057\147\160\154\056\150\164\155\154\076\012\124\150\151\163\040\151\163\040\146\162\145\145\040\163\157\146\164\167\141\162\145\072\040\171\157\165\040\141\162\145\040\146\162\145\145\040\164\157\040\143\150\141\156\147\145\040\141\156\144\040\162\145\144\151\163\164\162\151\142\165\164\145\040\151\164\056\012\124\150\145\162\145\040\151\163\040\116\117\040\127\101\122\122\101\116\124\131\054\040\164\157\040\164\150\145\040\145\170\164\145\156\164\040\160\145\162\155\151\164\164\145\144\040\142\171\040\154\141\167\056\012\012\127\162\151\164\164\145\156\040\142\171\040\101\157\162\141\156\040\132\145\156\147\054\040\110\145\156\147\040\107\165\157\040\141\156\144\040\143\157\156\164\162\151\142\165\164\157\162\163\056\040\050\123\145\145\040\143\150\163\162\143\055\155\141\151\156\056\143\051\012"; + +char RAWSTR_chsrc_for_issue[] = "\127\145\040\141\143\143\145\160\164\040\151\163\163\165\145\163\040\142\157\164\150\040\163\151\144\145\163\040\157\156\040\107\151\164\145\145\040\141\156\144\040\107\151\164\150\165\142\012\012\040\040\055\040\150\164\164\160\163\072\057\057\147\151\164\145\145\056\143\157\155\057\122\165\142\171\115\145\164\162\151\143\057\143\150\163\162\143\057\151\163\163\165\145\163\012\040\040\055\040\150\164\164\160\163\072\057\057\147\151\164\150\165\142\056\143\157\155\057\122\165\142\171\115\145\164\162\151\143\057\143\150\163\162\143\057\151\163\163\165\145\163\012\012\114\141\164\145\163\164\040\115\151\162\162\157\162\040\163\151\164\145\040\163\164\141\164\165\163\040\167\151\153\151\072\012\012\040\040\055\040\150\164\164\160\163\072\057\057\147\151\164\150\165\142\056\143\157\155\057\122\165\142\171\115\145\164\162\151\143\057\143\150\163\162\143\057\167\151\153\151\012"; + diff --git a/src/rawstr4c.md b/src/rawstr4c.md new file mode 100644 index 0000000..c8d7c38 --- /dev/null +++ b/src/rawstr4c.md @@ -0,0 +1,163 @@ + + +# rawstr4c input for chsrc + +`chsrc` 使用的 C标准 (最低要求) 是 `gnu11` (`c11` 的超集),这也就是说,我们项目是可以,而且是 **推荐** 同时混用 `R"()"` 和 `rawstr4c` 的 + +`LLVM` 对 `R"()"` 的支持是在 2024年07月 以后。但是在 GitHub Actions 中,所有出现的 `LLVM` 版本都太低了, +这使得我们被迫把已经写过的 `R"()"` 全部再转换为 `rawstr4c`. + +用户端的编译器一般比较新,然而可能也没有新到如此的地步,通过使用 `rawstr4c` 我们也放宽了用户对编译器的要求。 + +我们预计等2~3年后,在项目中重新开始 `R"()"` 的写法 + +
+ +- prefix = `RAWSTR_chsrc` +- output = `:global-variable-only-header` +- translate = `:oct` +- keep-postfix = `false` + +
+ +## 中文帮助 + +- name = `USAGE_CHINESE` + +``` +名称: + chsrc - Change Source - (GPLv3+) + +版本: + @ver@ + +使用: + chsrc [options] [target] [mirror] + +命令: + help, h 打印此帮助,或 -h, --help + issue 查看相关issue + + list, ls, l 列出可用镜像站和可换源目标 + list mirror|target 列出支持的: 镜像站/换源目标 + list os|lang|ware 列出支持的: 操作系统/编程语言/软件 + list 查看该目标可用源与支持功能 + + measure, m, cesu 对该目标所有源测速 + + get, g 查看该目标当前源的使用情况 + + set, s 换源,自动测速后挑选最快源 + set first 换源,使用维护团队测速第一的源 + set 换源,指定使用某镜像站 (通过list 查看) + set 换源,用户自定义源URL + reset 重置,使用上游默认使用的源 + +选项: + -dry Dry Run,模拟换源过程,命令仅打印并不运行 + -local 仅对本项目而非全局换源 (通过ls 查看支持情况) + -ipv6 使用IPv6测速 + -en(glish) 使用英文输出 + -no-color 无颜色输出 + +维护: + 邀请您担任 Chef, 为用户把关您熟悉的 recipe + 源代码地址: @url@ + 成为维护者: https://github.com/RubyMetric/chsrc/issues/130 +``` + +
+ + + +## 英文帮助 + +- name = `USAGE_ENGLISH` + +``` +NAME: + chsrc - Change Source - (GPLv3+) + +VERSION: + @ver@ + +USAGE: + chsrc [options] [target] [mirror] + +COMMANDS: + help, h Print this help, or -h, --help + issue See related issues + + list, ls, l List available mirror sites and supported targets + list mirror|target List supported: mirror sites/supported targets + list os|lang|ware List supported: OSes/Programming Languages/Softwares + list View available sources and supporting features for + + measure, m, cesu Measure velocity of all sources of + + get, g View the current source state for + + set, s Change source, select the fastest source by automatic speed measurement + set first Change source, select the fastest source measured by the maintainers team + set Change source, specify a mirror site (Via `list `) + set Change source, using user-defined source URL + reset Reset source to the upstream's default + +OPTIONS: + -dry Dry Run. Simulate the source changing process, command only prints, not run + -local Change source only for this project rather than globally (Via `ls `) + -ipv6 Speed measurement using IPv6 + -en(glish) Output in English + -no-color Output without color + +MAINTAIN: + We invite you to become a Chef to ensure the quality of recipes you are familiar with for users: + + Source Code: @url@, + Become a Maintainer: https://github.com/RubyMetric/chsrc/issues/130 +``` + +
+ + + +## for `chsrc -v` + +- name = `for__v` + +``` +chsrc @ver@ +Copyright (C) 2025 Aoran Zeng, Heng Guo +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Written by Aoran Zeng, Heng Guo and contributors. (See chsrc-main.c) +``` + +
+ + + +## for `chsrc issue` + +- name = `for_issue` + +``` +We accept issues both sides on Gitee and Github + + - https://gitee.com/RubyMetric/chsrc/issues + - https://github.com/RubyMetric/chsrc/issues + +Latest Mirror site status wiki: + + - https://github.com/RubyMetric/chsrc/wiki +```