From 304ac22a43c2b40492a51832c7e28349b6e7869d Mon Sep 17 00:00:00 2001 From: itowlson Date: Mon, 29 Jan 2024 14:36:44 +1300 Subject: [PATCH] Include trigger type in trigger options help header Signed-off-by: itowlson --- crates/trigger/src/cli.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index c04168a0e4..ce7127c467 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -32,7 +32,7 @@ pub const SPIN_WORKING_DIR: &str = "SPIN_WORKING_DIR"; #[derive(Parser, Debug)] #[clap( usage = "spin [COMMAND] [OPTIONS]", - next_help_heading = "TRIGGER OPTIONS" + next_help_heading = help_heading::() )] pub struct TriggerExecutorCommand where @@ -255,6 +255,12 @@ fn warn_if_wasm_build_slothful() -> sloth::SlothGuard { sloth::warn_if_slothful(SLOTH_WARNING_DELAY_MILLIS, format!("{message}\n")) } +fn help_heading() -> Option<&'static str> { + let heading = format!("{} TRIGGER OPTIONS", E::TRIGGER_TYPE.to_uppercase()); + let as_str = Box::new(heading).leak(); + Some(as_str) +} + pub mod help { use super::*;