Skip to content

Commit

Permalink
fix(From Usage): fixes a bug where adding empty lines werent ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Mar 10, 2016
1 parent 22000a0 commit c5c58c8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,10 @@ impl<'a, 'b> App<'a, 'b> {
/// # ;
/// ```
pub fn args_from_usage(mut self, usage: &'a str) -> Self {
for l in usage.lines() {
if l.len() == 0 { continue; }
self.p.add_arg(&Arg::from_usage(l.trim()));
for line in usage.lines() {
let l = line.trim();
if l.is_empty() { continue; }
self.p.add_arg(&Arg::from_usage(l));
}
self
}
Expand Down

0 comments on commit c5c58c8

Please sign in to comment.