From 5bbcc0f4bab5a95aa193ae1f4b228c7b8e84b4aa Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 14 Oct 2021 11:43:16 -0500 Subject: [PATCH] feat(app): Introspect current help heading This will help for #2803 so we can capture and restore the help heading around flattened derives. --- src/build/app/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs index 00388dd4..88666403 100644 --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -146,6 +146,14 @@ impl<'help> App<'help> { self.long_about } + /// Get the custom section heading specified via [`App::help_heading`]. + /// + /// [`App::help_heading`]: App::help_heading() + #[inline] + pub fn get_help_heading(&self) -> Option<&'help str> { + self.current_help_heading + } + /// Iterate through the *visible* aliases for this subcommand. #[inline] pub fn get_visible_aliases(&self) -> impl Iterator {