Skip to content

Commit

Permalink
fix(parser): Allow defaults for Help/Version
Browse files Browse the repository at this point in the history
These didn't make sense for the builder but are helpful for the derive.
The assert was assuming people wouldn't do this and to catch internal
problems.

Fixes #4326
  • Loading branch information
epage committed Oct 1, 2022
1 parent 8a124db commit dd8e242
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/parser/parser.rs
Expand Up @@ -1274,7 +1274,6 @@ impl<'cmd> Parser<'cmd> {
Ok(ParseResult::ValuesDone)
}
ArgAction::Help => {
debug_assert_eq!(raw_vals, Vec::<OsString>::new());
let use_long = match ident {
Some(Identifier::Long) => true,
Some(Identifier::Short) => false,
Expand All @@ -1285,7 +1284,6 @@ impl<'cmd> Parser<'cmd> {
Err(self.help_err(use_long))
}
ArgAction::Version => {
debug_assert_eq!(raw_vals, Vec::<OsString>::new());
let use_long = match ident {
Some(Identifier::Long) => true,
Some(Identifier::Short) => false,
Expand Down

0 comments on commit dd8e242

Please sign in to comment.