mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
fix: detect if space should be added before spec_vals
This commit is contained in:
parent
29df5c2d16
commit
530b179776
3 changed files with 12 additions and 11 deletions
|
@ -566,12 +566,13 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> {
|
|||
a.possible_vals
|
||||
);
|
||||
|
||||
spec_vals.push(format!(
|
||||
" [possible values: {}]",
|
||||
a.possible_vals.join(", ")
|
||||
));
|
||||
spec_vals.push(format!("[possible values: {}]", a.possible_vals.join(", ")));
|
||||
}
|
||||
spec_vals.join(" ")
|
||||
let prefix = match !spec_vals.is_empty() && !a.get_about().unwrap_or("").is_empty() {
|
||||
true => " ",
|
||||
false => "",
|
||||
};
|
||||
prefix.to_string() + &spec_vals.join(" ")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue