Skip to content

Commit

Permalink
fix(error): Include 'Usage:' title in --flag=bad-value error
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 27, 2022
1 parent 3a8d2a5 commit 12d76d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl<'cmd> Parser<'cmd> {
self.cmd,
rest,
arg,
Usage::new(self.cmd).create_usage_no_title(&used),
Usage::new(self.cmd).create_usage_with_title(&used),
));
}
ParseResult::MaybeHyphenValue => {
Expand Down
2 changes: 1 addition & 1 deletion tests/builder/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn unexpected_value_error() {
const USE_FLAG_AS_ARGUMENT: &str = "\
error: The value 'foo' was provided to '--a-flag' but it wasn't expecting any more values
mycat [OPTIONS] [filename]
Usage: mycat [OPTIONS] [filename]
For more information try '--help'
";
Expand Down

0 comments on commit 12d76d6

Please sign in to comment.