fix(App::args_from_usage): skips empty lines when parsing multiple lines from usage

This commit is contained in:
Kevin K 2016-02-02 02:16:45 -05:00
parent ee96baffd3
commit be2cbd9480

View file

@ -491,6 +491,7 @@ impl<'a, 'b> App<'a, 'b> {
/// ``` /// ```
pub fn args_from_usage(mut self, usage: &'a str) -> Self { pub fn args_from_usage(mut self, usage: &'a str) -> Self {
for l in usage.lines() { for l in usage.lines() {
if l.len() == 0 { continue; }
self.0.add_arg(&Arg::from_usage(l.trim())); self.0.add_arg(&Arg::from_usage(l.trim()));
} }
self self