chore: update

This commit is contained in:
nibon7 2022-11-21 19:29:53 +08:00
parent 8a75bfd5aa
commit 262de4abb2
No known key found for this signature in database
GPG key ID: 281CE465D8EEC03B

View file

@ -66,10 +66,11 @@ fn append_value_completion_and_help(
if let Some(help) = arg.get_help() {
let indent: usize = 30;
let mut width = 0;
if let Some(line) = s.lines().last() {
width = indent.saturating_sub(line.len());
}
let width = match s.lines().last() {
Some(line) => indent.saturating_sub(line.len()),
None => 0,
};
s.push_str(format!("{:>width$}# {}", ' ', help).as_str());
}