From bdf9eb3ffce9076f76ec29079c9977eb6dcda8e5 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 5 Jun 2026 23:06:39 +0800 Subject: Add verbose and dry_run fields as convention-only options --- mingling_core/src/program/config.rs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'mingling_core/src/program') diff --git a/mingling_core/src/program/config.rs b/mingling_core/src/program/config.rs index 5c104ab..4cca52f 100644 --- a/mingling_core/src/program/config.rs +++ b/mingling_core/src/program/config.rs @@ -10,6 +10,11 @@ pub struct ProgramStdoutSetting { /// Silence panic messages pub silence_panic: bool, + /// Verbose output: provide detailed information + /// + /// **NOTE**: Convention only, not a configuration + pub verbose: bool, + #[cfg(feature = "clap")] /// Behavior when Clap Dispatcher outputs help information pub clap_help_print_behaviour: ClapHelpPrintBehaviour, @@ -32,6 +37,7 @@ impl Default for ProgramStdoutSetting { error_output: true, render_output: true, silence_panic: false, + verbose: false, #[cfg(feature = "clap")] clap_help_print_behaviour: ClapHelpPrintBehaviour::default(), } @@ -44,19 +50,27 @@ pub struct ProgramUserContext { /// View help information instead of running the command pub help: bool, + /// Execute hooks during the program lifecycle + pub run_hook: bool, + /// Skip user confirmation step + /// + /// **NOTE**: Convention only, not a configuration pub confirm: bool, - /// Execute hooks during the program lifecycle - pub run_hook: bool, + /// Dry-run mode: simulate actions without making changes + /// + /// **NOTE**: Convention only, not a configuration + pub dry_run: bool, } impl Default for ProgramUserContext { fn default() -> Self { Self { help: false, - confirm: false, run_hook: true, + confirm: false, + dry_run: false, } } } -- cgit