Skip to content

Commit

Permalink
fix(assert): Reference help_expected
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jun 8, 2022
1 parent 28781d6 commit 10bb9ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/builder/command.rs
Expand Up @@ -4373,7 +4373,7 @@ impl<'help> App<'help> {
.collect();

assert!(args_missing_help.is_empty(),
"AppSettings::HelpExpected is enabled for the Command {}, but at least one of its arguments does not have either `help` or `long_help` set. List of such arguments: {}",
"Command::help_expected is enabled for the Command {}, but at least one of its arguments does not have either `help` or `long_help` set. List of such arguments: {}",
self.name,
args_missing_help.join(", ")
);
Expand Down
8 changes: 4 additions & 4 deletions tests/builder/help.rs
Expand Up @@ -1997,7 +1997,7 @@ fn issue_1487() {

#[cfg(debug_assertions)]
#[test]
#[should_panic = "AppSettings::HelpExpected is enabled for the Command"]
#[should_panic = "Command::help_expected is enabled for the Command"]
fn help_required_but_not_given() {
Command::new("myapp")
.help_expected(true)
Expand All @@ -2008,7 +2008,7 @@ fn help_required_but_not_given() {

#[cfg(debug_assertions)]
#[test]
#[should_panic = "AppSettings::HelpExpected is enabled for the Command"]
#[should_panic = "Command::help_expected is enabled for the Command"]
fn help_required_but_not_given_settings_after_args() {
Command::new("myapp")
.arg(Arg::new("foo"))
Expand All @@ -2019,7 +2019,7 @@ fn help_required_but_not_given_settings_after_args() {

#[cfg(debug_assertions)]
#[test]
#[should_panic = "AppSettings::HelpExpected is enabled for the Command"]
#[should_panic = "Command::help_expected is enabled for the Command"]
fn help_required_but_not_given_for_one_of_two_arguments() {
Command::new("myapp")
.help_expected(true)
Expand All @@ -2046,7 +2046,7 @@ fn help_required_globally() {

#[cfg(debug_assertions)]
#[test]
#[should_panic = "AppSettings::HelpExpected is enabled for the Command"]
#[should_panic = "Command::help_expected is enabled for the Command"]
fn help_required_globally_but_not_given_for_subcommand() {
Command::new("myapp")
.help_expected(true)
Expand Down
8 changes: 4 additions & 4 deletions tests/builder/legacy/help.rs
Expand Up @@ -1991,7 +1991,7 @@ fn issue_1487() {

#[cfg(debug_assertions)]
#[test]
#[should_panic = "AppSettings::HelpExpected is enabled for the Command"]
#[should_panic = "Command::help_expected is enabled for the Command"]
fn help_required_but_not_given() {
Command::new("myapp")
.help_expected(true)
Expand All @@ -2002,7 +2002,7 @@ fn help_required_but_not_given() {

#[cfg(debug_assertions)]
#[test]
#[should_panic = "AppSettings::HelpExpected is enabled for the Command"]
#[should_panic = "Command::help_expected is enabled for the Command"]
fn help_required_but_not_given_settings_after_args() {
Command::new("myapp")
.arg(Arg::new("foo"))
Expand All @@ -2013,7 +2013,7 @@ fn help_required_but_not_given_settings_after_args() {

#[cfg(debug_assertions)]
#[test]
#[should_panic = "AppSettings::HelpExpected is enabled for the Command"]
#[should_panic = "Command::help_expected is enabled for the Command"]
fn help_required_but_not_given_for_one_of_two_arguments() {
Command::new("myapp")
.help_expected(true)
Expand All @@ -2040,7 +2040,7 @@ fn help_required_globally() {

#[cfg(debug_assertions)]
#[test]
#[should_panic = "AppSettings::HelpExpected is enabled for the Command"]
#[should_panic = "Command::help_expected is enabled for the Command"]
fn help_required_globally_but_not_given_for_subcommand() {
Command::new("myapp")
.help_expected(true)
Expand Down

0 comments on commit 10bb9ab

Please sign in to comment.