Skip to content

Commit 96498fe

Browse files
authored
Merge pull request #2256 from itowlson/distinctify-trigger-help-headings
Include trigger type in trigger options help header
2 parents e5921ae + 304ac22 commit 96498fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/trigger/src/cli.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub const SPIN_WORKING_DIR: &str = "SPIN_WORKING_DIR";
3232
#[derive(Parser, Debug)]
3333
#[clap(
3434
usage = "spin [COMMAND] [OPTIONS]",
35-
next_help_heading = "TRIGGER OPTIONS"
35+
next_help_heading = help_heading::<Executor>()
3636
)]
3737
pub struct TriggerExecutorCommand<Executor: TriggerExecutor>
3838
where
@@ -255,6 +255,12 @@ fn warn_if_wasm_build_slothful() -> sloth::SlothGuard {
255255
sloth::warn_if_slothful(SLOTH_WARNING_DELAY_MILLIS, format!("{message}\n"))
256256
}
257257

258+
fn help_heading<E: TriggerExecutor>() -> Option<&'static str> {
259+
let heading = format!("{} TRIGGER OPTIONS", E::TRIGGER_TYPE.to_uppercase());
260+
let as_str = Box::new(heading).leak();
261+
Some(as_str)
262+
}
263+
258264
pub mod help {
259265
use super::*;
260266

0 commit comments

Comments
 (0)