Skip to content

Commit

Permalink
fix(Empty Values): fixes bug where empty values weren't stored
Browse files Browse the repository at this point in the history
Passing empty values, such as `--feature ""` now stores the empty string
correctly as a value (assuming empty values are allowed as per the arg
configuration)

Closes #470
  • Loading branch information
kbknapp committed Mar 30, 2016
1 parent d4b5545 commit 885d166
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,12 @@ impl<'a, 'b> Parser<'a, 'b> where 'a: 'b {
debugln!("fn=add_val_to_arg;");
let mut ret = None;
if let Some(delim) = arg.val_delim() {
for v in val.split(delim as u32 as u8) {
ret = try!(self.add_single_val_to_arg(arg, v, matcher));
if val.is_empty_() {
ret = try!(self.add_single_val_to_arg(arg, val, matcher));
} else {
for v in val.split(delim as u32 as u8) {
ret = try!(self.add_single_val_to_arg(arg, v, matcher));
}
}
} else {
ret = try!(self.add_single_val_to_arg(arg, val, matcher));
Expand Down

0 comments on commit 885d166

Please sign in to comment.