allow translation of "For more information, try '--help'."

This commit is contained in:
Sylvestre Ledru
2025-08-13 14:15:56 +02:00
parent 096cab0461
commit e8dccfc983
3 changed files with 5 additions and 3 deletions
+1
View File
@@ -13,6 +13,7 @@ clap-error-unexpected-argument = { $error_word }: unexpected argument '{ $arg }'
clap-error-similar-argument = { $tip_word }: a similar argument exists: '{ $suggestion }'
clap-error-pass-as-value = { $tip_word }: to pass '{ $arg }' as a value, use '{ $tip_command }'
clap-error-help-suggestion = For more information, try '{ $command } --help'.
common-help-suggestion = For more information, try '--help'.
# Common help text patterns
help-flag-help = Print help information
+1
View File
@@ -13,6 +13,7 @@ clap-error-unexpected-argument = { $error_word } : argument inattendu '{ $arg }'
clap-error-similar-argument = { $tip_word } : un argument similaire existe : '{ $suggestion }'
clap-error-pass-as-value = { $tip_word } : pour passer '{ $arg }' comme valeur, utilisez '{ $tip_command }'
clap-error-help-suggestion = Pour plus d'informations, essayez '{ $command } --help'.
common-help-suggestion = Pour plus d'informations, essayez '--help'.
# Modèles de texte d'aide communs
help-flag-help = Afficher les informations d'aide
+3 -3
View File
@@ -179,7 +179,7 @@ pub fn handle_clap_error_with_exit_code(err: Error, util_name: &str, exit_code:
let usage_label = translate!("common-usage");
eprintln!("{}: {}", usage_label, formatted_usage);
eprintln!();
eprintln!("For more information, try '--help'.");
eprintln!("{}", translate!("common-help-suggestion"));
std::process::exit(exit_code);
} else {
@@ -199,7 +199,7 @@ pub fn handle_clap_error_with_exit_code(err: Error, util_name: &str, exit_code:
eprintln!("{}", main_error_line);
eprintln!();
// Use the execution phrase for the help suggestion to match test expectations
eprintln!("For more information, try '--help'.");
eprintln!("{}", translate!("common-help-suggestion"));
} else {
// Fallback to original rendering if we can't parse
eprint!("{}", err.render());
@@ -233,7 +233,7 @@ pub fn handle_clap_error_with_exit_code(err: Error, util_name: &str, exit_code:
// For other errors, just show help suggestion
eprintln!();
eprintln!("For more information, try '--help'.");
eprintln!("{}", translate!("common-help-suggestion"));
std::process::exit(exit_code);
}