Skip to content

Commit

Permalink
fix: avoid trailing spaces on empty usage lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgrayson committed Mar 29, 2023
1 parent 0fdf182 commit f2c203a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ pub(crate) fn make_usage(command_name: &str, usages: &[&str]) -> clap::builder::
for (i, &usage) in usages.iter().enumerate() {
let indent = if i == 0 { "" } else { " " };
let end = if i + 1 == usages.len() { "" } else { "\n" };
let sep = if usage.is_empty() { "" } else { " " };
write!(
s,
"{indent}{}{command_name}{} {usage}{end}",
"{indent}{}{command_name}{}{sep}{usage}{end}",
bold.render(),
bold.render_reset()
)
Expand Down

0 comments on commit f2c203a

Please sign in to comment.