Skip to content

Commit

Permalink
Merge pull request #3860 from epage/panic
Browse files Browse the repository at this point in the history
fix(parser): Don't panic on `--=`
  • Loading branch information
epage committed Jun 21, 2022
2 parents dabb571 + 01da890 commit ceb7ee4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parser/parser.rs
Expand Up @@ -738,8 +738,10 @@ impl<'help, 'cmd> Parser<'help, 'cmd> {
}
};
if long_arg.is_empty() {
debug_assert!(long_value.is_none(), "{:?}", long_value);
return Ok(ParseResult::NoArg);
debug_assert!(
long_value.is_some(),
"`--` should be filtered out before this point"
);
}

let arg = if let Some(arg) = self.cmd.get_keymap().get(long_arg) {
Expand Down

0 comments on commit ceb7ee4

Please sign in to comment.