feat(cli): document SENBEI_LANG in --help

The help now names the display-language variable, its values, the
fallback to the system language, and that JSON and saved logs stay
English. It is printed between the resource limits and the exit codes,
in every language.
This commit is contained in:
Momoko-Ayase committed 2026-11-08 03:27:48 +08:00
1 parent 4853fe22c0
commit 3b28f1aaa4
8 files changed
+33

No files matched your search

+1
View File
@@ -466,6 +466,7 @@ fn print_help() {
entries: defaults.max_entries,
depth: defaults.max_depth,
},
Cli::HelpLanguage,
Cli::HelpExitCodes,
] {
println!("{}", block.localize(lang));
+14
View File
@@ -64,6 +64,20 @@ fn usage_errors_and_help_follow_the_language() {
}
}
#[test]
fn help_documents_the_language_variable_in_every_language() {
for lang in Lang::ALL {
let output = senbei(lang.tag()).arg("--help").output().unwrap();
assert!(output.status.success());
let help = text(&output.stdout);
assert!(
help.contains(&*Cli::HelpLanguage.localize(lang)),
"{lang:?}"
);
assert!(help.contains("SENBEI_LANG"), "{lang:?}");
}
}
#[test]
fn an_unknown_language_falls_back_to_english() {
for value in ["fr", "C", "x-unknown"] {