mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
fix(App::args_from_usage): skips empty lines when parsing multiple lines from usage
This commit is contained in:
parent
ee96baffd3
commit
be2cbd9480
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue