diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-26 01:23:39 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-26 01:23:39 +0800 |
| commit | d2c44d5c1cd8df2d150c849e8bd196e15c4015e3 (patch) | |
| tree | 824a2282c8c10923651e76d2c27956e0390ab6fd /mingling_core/src | |
| parent | 00923e2a4180c39ccc2d0ab51a7548fb7bfa5719 (diff) | |
Add clap_parser feature to mingling_core with help output behavior
config
Diffstat (limited to 'mingling_core/src')
| -rw-r--r-- | mingling_core/src/program/config.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mingling_core/src/program/config.rs b/mingling_core/src/program/config.rs index 2f5de4c..78c6185 100644 --- a/mingling_core/src/program/config.rs +++ b/mingling_core/src/program/config.rs @@ -6,6 +6,21 @@ pub struct ProgramStdoutSetting { /// Render results and output pub render_output: bool, + + #[cfg(feature = "clap_parser")] + /// Behavior when Clap Dispatcher outputs help information + pub clap_help_print_behaviour: ClapHelpPrintBehaviour, +} + +#[cfg(feature = "clap_parser")] +#[derive(Debug, Default, Clone)] +pub enum ClapHelpPrintBehaviour { + /// Write to RenderResult + WriteToRenderResult, + + /// Print directly + #[default] + PrintDirectly, } impl Default for ProgramStdoutSetting { @@ -13,6 +28,8 @@ impl Default for ProgramStdoutSetting { ProgramStdoutSetting { error_output: true, render_output: true, + #[cfg(feature = "clap_parser")] + clap_help_print_behaviour: ClapHelpPrintBehaviour::default(), } } } |
