From 12d76d649ad3e66147bf3ef03029e1d1d20f13de Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 27 Sep 2022 09:20:42 -0500 Subject: [PATCH] fix(error): Include 'Usage:' title in --flag=bad-value error --- src/parser/parser.rs | 2 +- tests/builder/flags.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/parser.rs b/src/parser/parser.rs index cd96d597..9fdaa4ef 100644 --- a/src/parser/parser.rs +++ b/src/parser/parser.rs @@ -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 => { diff --git a/tests/builder/flags.rs b/tests/builder/flags.rs index 48c54843..83d2464b 100644 --- a/tests/builder/flags.rs +++ b/tests/builder/flags.rs @@ -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' ";