From 10bc4ca7a4b3f14cfb57bf72a6da8aaa1490acf3 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 9 May 2026 16:42:50 +0800 Subject: Add lifecycle hooks to program execution --- mingling_core/src/program/config.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'mingling_core/src/program/config.rs') diff --git a/mingling_core/src/program/config.rs b/mingling_core/src/program/config.rs index ac541fd..35b9392 100644 --- a/mingling_core/src/program/config.rs +++ b/mingling_core/src/program/config.rs @@ -35,13 +35,26 @@ impl Default for ProgramStdoutSetting { } /// Program user context -#[derive(Debug, Clone, Default)] +#[derive(Debug, Clone)] pub struct ProgramUserContext { /// View help information instead of running the command pub help: bool, /// Skip user confirmation step pub confirm: bool, + + /// Execute hooks during the program lifecycle + pub run_hook: bool, +} + +impl Default for ProgramUserContext { + fn default() -> Self { + Self { + help: false, + confirm: false, + run_hook: true, + } + } } #[cfg(feature = "general_renderer")] -- cgit