Skip to content

Commit e869100

Browse files
committed
fix(help): fix formatting for option arguments with no long
1 parent 1da0905 commit e869100

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -549,19 +549,19 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
549549
format!("{}--{}=",
550550
if v.short.is_some() {", "} else {""},l)
551551
} else {
552-
"".to_owned()
552+
" ".to_owned()
553553
},
554554
format!("{}{}", v.name, if v.multiple{"..."} else {""}),
555555
if v.long.is_some() {
556556
self.get_spaces((longest_opt + 4) - (v.long.unwrap().len() + v.name.len() + 2 + mult))
557557
} else {
558558
// 7 is '--=' (3) + tab (4)
559-
self.get_spaces(longest_opt + 7)
559+
self.get_spaces((longest_opt + 6) - (v.name.len() + mult))
560560
},
561561
if let Some(h) = v.help {
562562
format!("{}{}", h,
563563
if let Some(ref pv) = v.possible_vals {
564-
format!(" [values:{}]", pv.iter().fold(String::new(), |acc, name| acc + &format!("{}",name)[..] ))
564+
format!(" [values:{}]", pv.iter().fold(String::new(), |acc, name| acc + &format!(" {}",name)[..] ))
565565
}else{
566566
"".to_owned()
567567
})

0 commit comments

Comments
 (0)