mirror of
https://github.com/Momoko-Ayase/Senbei.git
synced 2026-11-24 02:52:47 +08:00
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:
1 parent
4853fe22c0
commit
3b28f1aaa4
8 files changed
+33
No files matched your search
@@ -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"] {
|
||||
|
||||
Reference in new issue
Block a user