aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md10
-rw-r--r--docs/_zh_CN/pages/7-argument-parse-clap.md2
-rw-r--r--docs/_zh_CN/pages/8-setup-and-resources.md4
-rw-r--r--docs/_zh_CN/pages/other/features.md2
-rw-r--r--docs/pages/7-argument-parse-clap.md2
-rw-r--r--docs/pages/8-setup-and-resources.md4
-rw-r--r--docs/pages/other/features.md2
-rw-r--r--examples/example-clap-binding/src/main.rs4
-rw-r--r--examples/example-panic-unwind/src/main.rs2
-rw-r--r--mingling/src/example_docs.rs6
-rw-r--r--mingling/src/gen_program.rs2
-rw-r--r--mingling/src/setups/basic.rs7
-rw-r--r--mingling/src/setups/picker/basic.rs5
-rw-r--r--mingling/src/setups/picker/structural_renderer.rs12
-rw-r--r--mingling/src/setups/structural_renderer.rs12
-rw-r--r--mingling_core/src/program.rs28
-rw-r--r--mingling_core/src/program/collection.rs2
-rw-r--r--mingling_core/src/program/collection/mock.rs2
-rw-r--r--mingling_core/src/program/config.rs24
-rw-r--r--mingling_core/src/program/hook.rs2
-rw-r--r--mingling_core/src/program/once_exec.rs4
-rw-r--r--mingling_core/src/renderer/structural.rs2
-rw-r--r--mingling_core/tests/test-all/tests/integration.rs2
-rw-r--r--mingling_core/tests/test-structural-renderer/tests/integration.rs4
-rw-r--r--mingling_macros/src/attr/dispatcher_clap.rs4
-rw-r--r--mingling_macros/src/func/program_final_gen.rs2
26 files changed, 95 insertions, 57 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c7f0250..77ba50c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -375,7 +375,7 @@ None
- `pick_global_argument(program, arg)` → `program.pick_argument(arg)`
- Import `mingling::picker::PickerHelper` instead of `mingling::picker::{pick_global_flag, pick_global_argument}`
-4. **[`core:program`]** **[BREAKING]** Refactored the program configuration settings into typed enums. The previously boolean-based fields in `ProgramStdoutSetting` and `ProgramUserContext` have been replaced with new semantic enum types, improving type safety and self-documentation.
+4. **[`core:program`]** **[BREAKING]** Refactored the program configuration settings into typed enums and moved them to a dedicated `config` module. The previously boolean-based fields in `ProgramStdoutSetting` and `ProgramUserContext` have been replaced with new semantic enum types, improving type safety and self-documentation. Additionally, all configuration types — including `StructuralRendererSetting` — have been moved under `mingling_core::config`, with the `config` module made public.
**`ProgramStdoutSetting` changes:**
@@ -398,7 +398,12 @@ None
- `ProgramStdoutSetting::default()`: `ErrorOutput::Show`, `RenderOutput::Show`, `PanicSilence::Show`, `Verbosity::Normal`, `ColorOutput::Enabled`, `ProgressOutput::Enabled`
- `ProgramUserContext::default()`: `confirmation: ConfirmationMode::Confirm`, `execution: ExecutionMode::Normal`, `interaction: InteractionMode::NonInteractive`, `yes_assumption: YesAssumption::None`
- All new enum types are defined in `mingling_core::program::config` and re-exported from the `mingling_core` crate root.
+ **Module reorganization:**
+
+ - All config types are defined in `mingling_core::program::config`, which is now a public module (`pub mod config`).
+ - `StructuralRendererSetting` (previously exposed at the crate root) now lives in `mingling_core::config` and must be referenced as `mingling_core::config::StructuralRendererSetting`.
+ - Internal usages across `program.rs`, `collection.rs`, `mock.rs`, `once_exec.rs`, `hook.rs`, `structural.rs`, and setup modules have been updated to reference the new `config::` path.
+ - The `config` module is re-exported from the `mingling_core` crate root as `mingling_core::config`.
**Migration guide:**
@@ -415,6 +420,7 @@ None
- `ctx.force = true` → `ctx.execution = ExecutionMode::Force`
- `ctx.interactive = true` → `ctx.interaction = InteractionMode::Interactive`
- `ctx.assume_yes = true` → `ctx.yes_assumption = YesAssumption::AssumeYes`
+ - References to `mingling_core::StructuralRendererSetting` → `mingling_core::config::StructuralRendererSetting`
_Behavioral semantics are preserved — the same configuration states are expressible in both the old boolean form and the new enum form, but the typed enums eliminate impossible states (e.g., both `verbose` and `quiet` set simultaneously) and make the intent of each setting explicit through named variants._
diff --git a/docs/_zh_CN/pages/7-argument-parse-clap.md b/docs/_zh_CN/pages/7-argument-parse-clap.md
index fda93f3..22896d2 100644
--- a/docs/_zh_CN/pages/7-argument-parse-clap.md
+++ b/docs/_zh_CN/pages/7-argument-parse-clap.md
@@ -75,7 +75,7 @@ fn main() {
let mut program = ThisProgram::new();
program.with_setup(BasicProgramSetup);
program.stdout_setting.clap_help_print_behaviour =
- mingling::ClapHelpPrintBehaviour::WriteToRenderResult;
+ mingling::config::ClapHelpPrintBehaviour::WriteToRenderResult;
program.with_dispatcher(CMDGreet);
program.exec_and_exit();
}
diff --git a/docs/_zh_CN/pages/8-setup-and-resources.md b/docs/_zh_CN/pages/8-setup-and-resources.md
index 79d1cb5..5889bfa 100644
--- a/docs/_zh_CN/pages/8-setup-and-resources.md
+++ b/docs/_zh_CN/pages/8-setup-and-resources.md
@@ -11,7 +11,7 @@
// Features: ["extras"]
@@@use mingling::macros::program_setup;
@@@use mingling::Program;
-@@@use mingling::Verbosity;
+@@@use mingling::config::Verbosity;
#[program_setup]
fn my_setup(program: &mut Program<ThisProgram>) {
// 从参数中提取全局标志
@@ -43,7 +43,7 @@ Setup 里最常用的操作就是提取全局参数。Mingling 提供了几个
// Features: ["extras"]
@@@use mingling::macros::program_setup;
@@@use mingling::Program;
-@@@use mingling::Verbosity;
+@@@use mingling::config::Verbosity;
#[program_setup]
fn my_setup(program: &mut Program<ThisProgram>) {
// 布尔标志
diff --git a/docs/_zh_CN/pages/other/features.md b/docs/_zh_CN/pages/other/features.md
index f307e4e..7ed3f5f 100644
--- a/docs/_zh_CN/pages/other/features.md
+++ b/docs/_zh_CN/pages/other/features.md
@@ -195,7 +195,7 @@ fn handle_state_prev1(_p: StatePrev1) -> Next {
```rust
// Features: ["extras"]
-use mingling::{ErrorOutput, macros::program_setup, Program};
+use mingling::{config::ErrorOutput, macros::program_setup, Program};
fn main() {
let mut program = ThisProgram::new();
diff --git a/docs/pages/7-argument-parse-clap.md b/docs/pages/7-argument-parse-clap.md
index dcebd65..3b8ec8b 100644
--- a/docs/pages/7-argument-parse-clap.md
+++ b/docs/pages/7-argument-parse-clap.md
@@ -75,7 +75,7 @@ fn main() {
let mut program = ThisProgram::new();
program.with_setup(BasicProgramSetup);
program.stdout_setting.clap_help_print_behaviour =
- mingling::ClapHelpPrintBehaviour::WriteToRenderResult;
+ mingling::config::ClapHelpPrintBehaviour::WriteToRenderResult;
program.with_dispatcher(CMDGreet);
program.exec_and_exit();
}
diff --git a/docs/pages/8-setup-and-resources.md b/docs/pages/8-setup-and-resources.md
index ae9e18c..1da05ff 100644
--- a/docs/pages/8-setup-and-resources.md
+++ b/docs/pages/8-setup-and-resources.md
@@ -11,7 +11,7 @@ When a program needs to do some init work at startup—like parsing global args
// Features: ["extras"]
@@@use mingling::macros::program_setup;
@@@use mingling::Program;
-@@@use mingling::Verbosity;
+@@@use mingling::config::Verbosity;
#[program_setup]
fn my_setup(program: &mut Program<ThisProgram>) {
// Extract global flag from args
@@ -43,7 +43,7 @@ The most common use of Setup is extracting global args. Mingling provides a few
// Features: ["extras"]
@@@use mingling::macros::program_setup;
@@@use mingling::Program;
-@@@use mingling::Verbosity;
+@@@use mingling::config::Verbosity;
#[program_setup]
fn my_setup(program: &mut Program<ThisProgram>) {
// Boolean flag
diff --git a/docs/pages/other/features.md b/docs/pages/other/features.md
index ac9d5db..7615118 100644
--- a/docs/pages/other/features.md
+++ b/docs/pages/other/features.md
@@ -195,7 +195,7 @@ fn handle_state_prev1(_p: StatePrev1) -> Next {
```rust
// Features: ["extras"]
-use mingling::{ErrorOutput, macros::program_setup, Program};
+use mingling::{config::ErrorOutput, macros::program_setup, Program};
fn main() {
let mut program = ThisProgram::new();
diff --git a/examples/example-clap-binding/src/main.rs b/examples/example-clap-binding/src/main.rs
index 0f839c8..d25c5f3 100644
--- a/examples/example-clap-binding/src/main.rs
+++ b/examples/example-clap-binding/src/main.rs
@@ -50,8 +50,8 @@ fn main() {
// Set clap help output mode
program.stdout_setting.clap_help_print_behaviour =
- mingling::ClapHelpPrintBehaviour::WriteToRenderResult;
- // mingling::ClapHelpPrintBehaviour::PrintDirectly
+ mingling::config::ClapHelpPrintBehaviour::WriteToRenderResult;
+ // mingling::config::ClapHelpPrintBehaviour::PrintDirectly
//
// PrintDirectly:
// Let Clap print help information directly to stdout
diff --git a/examples/example-panic-unwind/src/main.rs b/examples/example-panic-unwind/src/main.rs
index 5d34275..2c432eb 100644
--- a/examples/example-panic-unwind/src/main.rs
+++ b/examples/example-panic-unwind/src/main.rs
@@ -15,7 +15,7 @@
//! OhMyGod
//! ```
-use mingling::PanicSilence;
+use mingling::config::PanicSilence;
use mingling::{hook::ProgramHook, prelude::*};
use std::io::Write;
diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs
index fb0a6fc..55aabdf 100644
--- a/mingling/src/example_docs.rs
+++ b/mingling/src/example_docs.rs
@@ -635,8 +635,8 @@ pub mod example_basic {}
///
/// // Set clap help output mode
/// program.stdout_setting.clap_help_print_behaviour =
-/// mingling::ClapHelpPrintBehaviour::WriteToRenderResult;
-/// // mingling::ClapHelpPrintBehaviour::PrintDirectly
+/// mingling::config::ClapHelpPrintBehaviour::WriteToRenderResult;
+/// // mingling::config::ClapHelpPrintBehaviour::PrintDirectly
/// //
/// // PrintDirectly:
/// // Let Clap print help information directly to stdout
@@ -2472,7 +2472,7 @@ pub mod example_pack_err {}
///
/// Source code (./src/main.rs)
/// ```ignore
-/// use mingling::PanicSilence;
+/// use mingling::config::PanicSilence;
/// use mingling::{hook::ProgramHook, prelude::*};
/// use std::io::Write;
///
diff --git a/mingling/src/gen_program.rs b/mingling/src/gen_program.rs
index fbced64..6a0b144 100644
--- a/mingling/src/gen_program.rs
+++ b/mingling/src/gen_program.rs
@@ -253,7 +253,7 @@ impl ProgramCollect for ThisProgram {
#[cfg(feature = "structural_renderer")]
fn structural_render(
_any: mingling_core::AnyOutput<Self::Enum>,
- _setting: &mingling_core::StructuralRendererSetting,
+ _setting: &mingling_core::config::StructuralRendererSetting,
) -> Result<mingling_core::RenderResult, mingling_core::error::StructuralRendererSerializeError>
{
todo!()
diff --git a/mingling/src/setups/basic.rs b/mingling/src/setups/basic.rs
index 0d41d14..e2246e0 100644
--- a/mingling/src/setups/basic.rs
+++ b/mingling/src/setups/basic.rs
@@ -2,7 +2,8 @@
#![allow(deprecated)]
use mingling_core::{
- ConfirmationMode, Flag, InteractionMode, Program, ProgramCollect, YesAssumption,
+ Flag, Program, ProgramCollect,
+ config::{ConfirmationMode, ErrorOutput, InteractionMode, RenderOutput, YesAssumption},
setup::ProgramSetup,
};
@@ -95,8 +96,8 @@ where
{
fn setup(self, program: &mut Program<C>) {
program.global_flag(self.flag, |p| {
- p.stdout_setting.render_output = mingling_core::RenderOutput::Hide;
- p.stdout_setting.error_output = mingling_core::ErrorOutput::Hide;
+ p.stdout_setting.render_output = RenderOutput::Hide;
+ p.stdout_setting.error_output = ErrorOutput::Hide;
});
}
}
diff --git a/mingling/src/setups/picker/basic.rs b/mingling/src/setups/picker/basic.rs
index 438ed40..76b7857 100644
--- a/mingling/src/setups/picker/basic.rs
+++ b/mingling/src/setups/picker/basic.rs
@@ -1,8 +1,9 @@
// Doc Not Optimize
use arg_picker::{PickerArg, value::Flag};
use mingling_core::{
- ConfirmationMode, ErrorOutput, InteractionMode, Program, ProgramCollect, RenderOutput,
- YesAssumption, setup::ProgramSetup,
+ Program, ProgramCollect,
+ config::{ConfirmationMode, ErrorOutput, InteractionMode, RenderOutput, YesAssumption},
+ setup::ProgramSetup,
};
use crate::{
diff --git a/mingling/src/setups/picker/structural_renderer.rs b/mingling/src/setups/picker/structural_renderer.rs
index bd9b401..998fa16 100644
--- a/mingling/src/setups/picker/structural_renderer.rs
+++ b/mingling/src/setups/picker/structural_renderer.rs
@@ -48,27 +48,27 @@ where
fn setup(self, program: &mut Program<C>) {
#[cfg(feature = "json_serde_fmt")]
if program.pick_flag(&crate::consts::JSON_FLAG) {
- program.structural_renderer_name = crate::StructuralRendererSetting::Json;
+ program.structural_renderer_name = crate::config::StructuralRendererSetting::Json;
}
#[cfg(feature = "json_serde_fmt")]
if program.pick_flag(&crate::consts::JSON_PRETTY_FLAG) {
- program.structural_renderer_name = crate::StructuralRendererSetting::JsonPretty;
+ program.structural_renderer_name = crate::config::StructuralRendererSetting::JsonPretty;
}
#[cfg(feature = "yaml_serde_fmt")]
if program.pick_flag(&crate::consts::YAML_FLAG) {
- program.structural_renderer_name = crate::StructuralRendererSetting::Yaml;
+ program.structural_renderer_name = crate::config::StructuralRendererSetting::Yaml;
}
#[cfg(feature = "toml_serde_fmt")]
if program.pick_flag(&crate::consts::TOML_FLAG) {
- program.structural_renderer_name = crate::StructuralRendererSetting::Toml;
+ program.structural_renderer_name = crate::config::StructuralRendererSetting::Toml;
}
#[cfg(feature = "ron_serde_fmt")]
if program.pick_flag(&crate::consts::RON_FLAG) {
- program.structural_renderer_name = crate::StructuralRendererSetting::Ron;
+ program.structural_renderer_name = crate::config::StructuralRendererSetting::Ron;
}
#[cfg(feature = "ron_serde_fmt")]
if program.pick_flag(&crate::consts::RON_PRETTY_FLAG) {
- program.structural_renderer_name = crate::StructuralRendererSetting::RonPretty;
+ program.structural_renderer_name = crate::config::StructuralRendererSetting::RonPretty;
}
}
}
diff --git a/mingling/src/setups/structural_renderer.rs b/mingling/src/setups/structural_renderer.rs
index d6f45b7..6580c57 100644
--- a/mingling/src/setups/structural_renderer.rs
+++ b/mingling/src/setups/structural_renderer.rs
@@ -50,27 +50,27 @@ where
fn setup(self, program: &mut Program<C>) {
#[cfg(feature = "json_serde_fmt")]
program.global_flag("--json", |p| {
- p.structural_renderer_name = crate::StructuralRendererSetting::Json;
+ p.structural_renderer_name = crate::config::StructuralRendererSetting::Json;
});
#[cfg(feature = "json_serde_fmt")]
program.global_flag("--json-pretty", |p| {
- p.structural_renderer_name = crate::StructuralRendererSetting::JsonPretty;
+ p.structural_renderer_name = crate::config::StructuralRendererSetting::JsonPretty;
});
#[cfg(feature = "yaml_serde_fmt")]
program.global_flag("--yaml", |p| {
- p.structural_renderer_name = crate::StructuralRendererSetting::Yaml;
+ p.structural_renderer_name = crate::config::StructuralRendererSetting::Yaml;
});
#[cfg(feature = "toml_serde_fmt")]
program.global_flag("--toml", |p| {
- p.structural_renderer_name = crate::StructuralRendererSetting::Toml;
+ p.structural_renderer_name = crate::config::StructuralRendererSetting::Toml;
});
#[cfg(feature = "ron_serde_fmt")]
program.global_flag("--ron", |p| {
- p.structural_renderer_name = crate::StructuralRendererSetting::Ron;
+ p.structural_renderer_name = crate::config::StructuralRendererSetting::Ron;
});
#[cfg(feature = "ron_serde_fmt")]
program.global_flag("--ron-pretty", |p| {
- p.structural_renderer_name = crate::StructuralRendererSetting::RonPretty;
+ p.structural_renderer_name = crate::config::StructuralRendererSetting::RonPretty;
});
}
}
diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs
index 3c4212c..86e3e83 100644
--- a/mingling_core/src/program.rs
+++ b/mingling_core/src/program.rs
@@ -2,41 +2,47 @@
#[cfg(not(windows))]
use std::env;
+#[cfg(feature = "structural_renderer")]
+use crate::config::StructuralRendererSetting;
use crate::{
- AnyOutput, GlobalResContainer, asset::dispatcher::Dispatcher, error::ChainProcessError,
+ AnyOutput, GlobalResContainer,
+ asset::dispatcher::Dispatcher,
+ config::{ProgramStdoutSetting, ProgramUserContext},
+ error::ChainProcessError,
hook::ProgramHook,
};
+pub mod config;
+
#[doc(hidden)]
pub mod error;
+
#[doc(hidden)]
pub mod exec;
-#[doc(hidden)]
-pub mod setup;
pub mod hook;
-mod collection;
-pub use collection::*;
-
-mod once_exec;
-
#[cfg(feature = "repl")]
#[doc(hidden)]
pub mod repl_exec;
+#[doc(hidden)]
+pub mod setup;
+
+mod collection;
+pub use collection::*;
+
mod single_instance;
pub use single_instance::*;
-mod config;
-pub use config::*;
-
mod flag;
pub use flag::*;
mod string_vec;
pub use string_vec::*;
+mod once_exec;
+
/// Program, used to define the behavior of the entire command-line program
#[derive(Default)]
pub struct Program<C>
diff --git a/mingling_core/src/program/collection.rs b/mingling_core/src/program/collection.rs
index 0a37106..2b3e9ec 100644
--- a/mingling_core/src/program/collection.rs
+++ b/mingling_core/src/program/collection.rs
@@ -8,7 +8,7 @@ use crate::Dispatcher;
use crate::{AnyOutput, ChainProcess, Grouped, RenderResult};
#[cfg(feature = "structural_renderer")]
-use crate::{StructuralRendererSetting, error::StructuralRendererSerializeError};
+use crate::{config::StructuralRendererSetting, error::StructuralRendererSerializeError};
#[cfg(feature = "comp")]
use crate::{ShellContext, Suggest};
diff --git a/mingling_core/src/program/collection/mock.rs b/mingling_core/src/program/collection/mock.rs
index 634d529..6b4406e 100644
--- a/mingling_core/src/program/collection/mock.rs
+++ b/mingling_core/src/program/collection/mock.rs
@@ -10,7 +10,7 @@ use crate::Dispatcher;
use crate::{ShellContext, Suggest};
#[cfg(feature = "structural_renderer")]
-use crate::{StructuralRendererSetting, error::StructuralRendererSerializeError};
+use crate::{config::StructuralRendererSetting, error::StructuralRendererSerializeError};
#[cfg(feature = "structural_renderer")]
use serde::Serialize;
diff --git a/mingling_core/src/program/config.rs b/mingling_core/src/program/config.rs
index 86b8c23..dae3f0a 100644
--- a/mingling_core/src/program/config.rs
+++ b/mingling_core/src/program/config.rs
@@ -1,4 +1,28 @@
// Doc Not Optimize
+
+//! Config module for program output settings and user context.
+//!
+//! This module provides configuration types and settings for controlling
+//! how the program outputs errors, rendered results, panic messages,
+//! verbosity levels, colors, progress indicators, and other user-defined
+//! context values used throughout the program lifecycle.
+//!
+//! The module includes the following items:
+//! - [`ErrorOutput`]: Output mode for error messages.
+//! - [`RenderOutput`]: Output mode for rendered results.
+//! - [`PanicSilence`]: Panic message handling.
+//! - [`Verbosity`]: Verbosity level for program output.
+//! - [`ColorOutput`]: Color output mode.
+//! - [`ProgressOutput`]: Progress indicator mode.
+//! - [`ProgramStdoutSetting`]: Program stdout settings.
+//! - [`ClapHelpPrintBehaviour`]: Behavior when Clap Dispatcher outputs help information.
+//! - [`ConfirmationMode`]: Confirmation mode for user prompts.
+//! - [`ExecutionMode`]: Execution mode.
+//! - [`InteractionMode`]: Interaction mode.
+//! - [`YesAssumption`]: Yes assumption mode for prompts.
+//! - [`ProgramUserContext`]: Program user context.
+//! - [`StructuralRendererSetting`]: Settings for the structural renderer output format.
+
/// Output mode for error messages
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ErrorOutput {
diff --git a/mingling_core/src/program/hook.rs b/mingling_core/src/program/hook.rs
index cb8e4e1..8fd2ba1 100644
--- a/mingling_core/src/program/hook.rs
+++ b/mingling_core/src/program/hook.rs
@@ -768,7 +768,7 @@ mod tests {
#[cfg(feature = "structural_renderer")]
fn structural_render(
_any: crate::AnyOutput<Self>,
- _setting: &crate::StructuralRendererSetting,
+ _setting: &crate::config::StructuralRendererSetting,
) -> Result<crate::RenderResult, crate::error::StructuralRendererSerializeError> {
unreachable!()
}
diff --git a/mingling_core/src/program/once_exec.rs b/mingling_core/src/program/once_exec.rs
index b1fba36..e9927b5 100644
--- a/mingling_core/src/program/once_exec.rs
+++ b/mingling_core/src/program/once_exec.rs
@@ -99,7 +99,7 @@ where
// Read exit code
// Render result
- if stdout_setting.render_output == crate::RenderOutput::Show {
+ if stdout_setting.render_output == crate::config::RenderOutput::Show {
result.std_print();
}
@@ -163,7 +163,7 @@ where
.unwrap();
#[cfg(not(panic = "abort"))]
- if program.stdout_setting.silence_panic == super::PanicSilence::Silence {
+ if program.stdout_setting.silence_panic == super::config::PanicSilence::Silence {
std::panic::set_hook(Box::new(|_| {}));
}
diff --git a/mingling_core/src/renderer/structural.rs b/mingling_core/src/renderer/structural.rs
index aeb637f..b2c1f8a 100644
--- a/mingling_core/src/renderer/structural.rs
+++ b/mingling_core/src/renderer/structural.rs
@@ -1,6 +1,6 @@
// Doc Not Optimize
use crate::{
- ProgramCollect, RenderResult, StructuralRendererSetting,
+ ProgramCollect, RenderResult, config::StructuralRendererSetting,
renderer::structural::error::StructuralRendererSerializeError,
};
use serde::Serialize;
diff --git a/mingling_core/tests/test-all/tests/integration.rs b/mingling_core/tests/test-all/tests/integration.rs
index acb12db..936ca52 100644
--- a/mingling_core/tests/test-all/tests/integration.rs
+++ b/mingling_core/tests/test-all/tests/integration.rs
@@ -6,7 +6,7 @@ use mingling::RenderResult;
use mingling::StringVec;
use mingling::StructuralData;
use mingling::StructuralRenderer;
-use mingling::StructuralRendererSetting;
+use mingling::config::StructuralRendererSetting;
use mingling::core_res::ResREPL;
use mingling::hook::ProgramHook;
use mingling::{ShellContext, ShellFlag, Suggest};
diff --git a/mingling_core/tests/test-structural-renderer/tests/integration.rs b/mingling_core/tests/test-structural-renderer/tests/integration.rs
index e4057f8..3c017b4 100644
--- a/mingling_core/tests/test-structural-renderer/tests/integration.rs
+++ b/mingling_core/tests/test-structural-renderer/tests/integration.rs
@@ -1,4 +1,5 @@
-use mingling::{RenderResult, StructuralData, StructuralRenderer, StructuralRendererSetting};
+use mingling::config::StructuralRendererSetting;
+use mingling::{RenderResult, StructuralData, StructuralRenderer};
use serde::Serialize;
#[derive(Debug, Clone, PartialEq, Serialize, StructuralData)]
@@ -76,4 +77,3 @@ fn test_render_ron() {
}
mingling::macros::gen_program!();
-
diff --git a/mingling_macros/src/attr/dispatcher_clap.rs b/mingling_macros/src/attr/dispatcher_clap.rs
index 88117e6..9aa7779 100644
--- a/mingling_macros/src/attr/dispatcher_clap.rs
+++ b/mingling_macros/src/attr/dispatcher_clap.rs
@@ -154,7 +154,7 @@ pub(crate) fn dispatcher_clap_attr(attr: TokenStream, item: TokenStream) -> Toke
let this = ::mingling::this::<#program_path>();
match this.stdout_setting.clap_help_print_behaviour {
- ::mingling::ClapHelpPrintBehaviour::WriteToRenderResult => {
+ ::mingling::config::ClapHelpPrintBehaviour::WriteToRenderResult => {
let mut cmd = <#struct_name as ::clap::CommandFactory>::command()
.color(ColorChoice::Always);
let styled = cmd.render_help();
@@ -162,7 +162,7 @@ pub(crate) fn dispatcher_clap_attr(attr: TokenStream, item: TokenStream) -> Toke
let _ = write!(result, "{}", styled.ansi());
result
}
- ::mingling::ClapHelpPrintBehaviour::PrintDirectly => {
+ ::mingling::config::ClapHelpPrintBehaviour::PrintDirectly => {
let mut command = <#struct_name as ::clap::CommandFactory>::command();
command.print_help().unwrap();
::mingling::RenderResult::new()
diff --git a/mingling_macros/src/func/program_final_gen.rs b/mingling_macros/src/func/program_final_gen.rs
index 7c18736..25bca5e 100644
--- a/mingling_macros/src/func/program_final_gen.rs
+++ b/mingling_macros/src/func/program_final_gen.rs
@@ -101,7 +101,7 @@ pub(crate) fn program_final_gen_impl(_input: TokenStream) -> TokenStream {
let structural_render = quote! {
fn structural_render(
any: ::mingling::AnyOutput<Self::Enum>,
- setting: &::mingling::StructuralRendererSetting,
+ setting: &::mingling::config::StructuralRendererSetting,
) -> Result<::mingling::RenderResult, ::mingling::error::StructuralRendererSerializeError> {
match any.member_id() {
#(#structural_renderer_tokens)*