From 807ddbbb70c2ba6a87393da126d57f9e083af374 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 17 Jan 2022 08:36:37 -0600 Subject: [PATCH] refactor: Build help subcommand separately --- src/build/app/mod.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs index df97e91631a..b3cf6fe9574 100644 --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -2902,13 +2902,12 @@ impl<'help> App<'help> { && !self.subcommands.iter().any(|s| s.id == Id::help_hash()) { debug!("App::_check_help_and_version: Building help subcommand"); - self.subcommands.push( - App::new("help") - .about("Print this message or the help of the given subcommand(s)") - // The parser acts like this is set, so let's set it so we don't falsely - // advertise it to the user - .setting(AppSettings::DisableHelpFlag), - ); + let help_subcmd = App::new("help") + .about("Print this message or the help of the given subcommand(s)") + // The parser acts like this is set, so let's set it so we don't falsely + // advertise it to the user + .setting(AppSettings::DisableHelpFlag); + self.subcommands.push(help_subcmd); } }