We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7e54542 + 6ffc88f commit cf15d48Copy full SHA for cf15d48
clap_complete/src/aot/shells/powershell.rs
@@ -63,10 +63,13 @@ fn escape_string(string: &str) -> String {
63
}
64
65
fn escape_help<T: ToString>(help: Option<&StyledStr>, data: T) -> String {
66
- match help {
67
- Some(help) => escape_string(&help.to_string().replace('\n', " ")),
68
- _ => data.to_string(),
+ if let Some(help) = help {
+ let help_str = help.to_string();
+ if !help_str.is_empty() {
69
+ return escape_string(&help_str.replace('\n', " "));
70
+ }
71
72
+ data.to_string()
73
74
75
fn generate_inner(p: &Command, previous_command_name: &str) -> String {
0 commit comments