Skip to content

Commit

Permalink
fix(help): fix formatting for option arguments with no long
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Apr 2, 2015
1 parent 1da0905 commit e869100
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,19 +549,19 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
format!("{}--{}=",
if v.short.is_some() {", "} else {""},l)
} else {
"".to_owned()
" ".to_owned()
},
format!("{}{}", v.name, if v.multiple{"..."} else {""}),
if v.long.is_some() {
self.get_spaces((longest_opt + 4) - (v.long.unwrap().len() + v.name.len() + 2 + mult))
} else {
// 7 is '--=' (3) + tab (4)
self.get_spaces(longest_opt + 7)
self.get_spaces((longest_opt + 6) - (v.name.len() + mult))
},
if let Some(h) = v.help {
format!("{}{}", h,
if let Some(ref pv) = v.possible_vals {
format!(" [values:{}]", pv.iter().fold(String::new(), |acc, name| acc + &format!("{}",name)[..] ))
format!(" [values:{}]", pv.iter().fold(String::new(), |acc, name| acc + &format!(" {}",name)[..] ))
}else{
"".to_owned()
})
Expand Down

0 comments on commit e869100

Please sign in to comment.