diff options
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | mingling_core/src/program/config.rs | 44 |
2 files changed, 45 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 91de864..4c86be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,7 @@ program.with_setup(ConfirmFlagSetup::new(["-C", "--confirm"])); program.with_setup(BasicProgramSetup); ``` -3. **\[core\]** Added `verbose` option to `ProgramStdoutSetting` and `dry_run` option to `ProgramUserContext`. These fields are annotated as conventions only, meaning the framework does not enforce any particular behavior — it is up to the application to read and act on them. +3. **\[core\]** Added `verbose`, `quiet`, `debug`, `color`, and `progress` fields to `ProgramStdoutSetting`, and `dry_run`, `force`, `interactive`, and `assume_yes` fields to `ProgramUserContext`. These fields are annotated as conventions only, meaning the framework does not enforce any particular behavior — it is up to the application to read and act on them. #### **BREAKING CHANGES** (API CHANGES): diff --git a/mingling_core/src/program/config.rs b/mingling_core/src/program/config.rs index 4cca52f..42603a5 100644 --- a/mingling_core/src/program/config.rs +++ b/mingling_core/src/program/config.rs @@ -15,6 +15,28 @@ pub struct ProgramStdoutSetting { /// **NOTE**: Convention only, not a configuration pub verbose: bool, + /// Quiet mode: suppress status messages, show only errors and results + /// + /// **NOTE**: Convention only, not a configuration + pub quiet: bool, + + /// Debug mode: output internal state and detailed diagnostics + /// + /// **NOTE**: Convention only, not a configuration + pub debug: bool, + + /// Enable colored output + /// + /// **NOTE**: Convention only, not a configuration + pub color: bool, + + /// Show progress indicators (e.g. progress bars, spinners) + /// + /// Automatically disabled when stdout is not a tty. + /// + /// **NOTE**: Convention only, not a configuration + pub progress: bool, + #[cfg(feature = "clap")] /// Behavior when Clap Dispatcher outputs help information pub clap_help_print_behaviour: ClapHelpPrintBehaviour, @@ -38,6 +60,10 @@ impl Default for ProgramStdoutSetting { render_output: true, silence_panic: false, verbose: false, + quiet: false, + debug: false, + color: true, + progress: true, #[cfg(feature = "clap")] clap_help_print_behaviour: ClapHelpPrintBehaviour::default(), } @@ -62,6 +88,21 @@ pub struct ProgramUserContext { /// /// **NOTE**: Convention only, not a configuration pub dry_run: bool, + + /// Force execution, skipping safety checks + /// + /// **NOTE**: Convention only, not a configuration + pub force: bool, + + /// Whether the program is running in an interactive terminal (has a tty) + /// + /// **NOTE**: Convention only, not a configuration + pub interactive: bool, + + /// Assume "yes" for all confirmation prompts + /// + /// **NOTE**: Convention only, not a configuration + pub assume_yes: bool, } impl Default for ProgramUserContext { @@ -71,6 +112,9 @@ impl Default for ProgramUserContext { run_hook: true, confirm: false, dry_run: false, + force: false, + interactive: false, + assume_yes: false, } } } |
