diff options
Diffstat (limited to 'docs/pages/other/features.md')
| -rw-r--r-- | docs/pages/other/features.md | 76 |
1 files changed, 68 insertions, 8 deletions
diff --git a/docs/pages/other/features.md b/docs/pages/other/features.md index 7994d4c..ac9d5db 100644 --- a/docs/pages/other/features.md +++ b/docs/pages/other/features.md @@ -3,6 +3,66 @@ <b>Mingling</b>'s complete feature list </p> +# Preset Feature Groups + +Mingling provides a set of **preset feature groups** that make it easy to enable features in whatever combination you need. + +## `mini` + +**Enables features:** `extras`, `picker` + +**Positioning:** Minimal mode, suitable for small CLI tools or projects that need to get started quickly. Includes only the most essential convenience macros and argument parsing capabilities. + +## `advanced` + +**Enables features:** `extras`, `picker`, `repl`, `comp`, `dispatch_tree`, `structural_renderer` + +**Positioning:** Advanced mode, builds on `mini` by adding an interactive REPL environment, code completion, dispatch tree acceleration, and basic structured output capabilities. Suitable for medium-sized command-line applications with a fuller feature set. + +## `full` + +**Enables features:** `extras`, `picker`, `repl`, `clap`, `comp`, `dispatch_tree`, `structural_renderer_full`, `pathf` + +**Positioning:** Full mode, enables all of Mingling's core functionality. In addition to `advanced`, it includes clap integration, the full structural renderer (with all serialization formats), and the experimental path analyzer. Suitable for large, feature-complete command-line applications. + +## `build_advanced` + +**Enables features:** `build`, `comp` + +**Positioning:** Build-time enhanced configuration, used to generate build helpers such as completion scripts at build time (the `comp` feature provides completion script generation). + +> [!NOTE] +> +> This feature group is intended for **build dependencies** only and must be used alongside the `advanced` feature. Enable it in the `[build-dependencies]` section of `Cargo.toml`: + +```toml +[dependencies.mingling] +features = ["advanced"] + +[build-dependencies.mingling] +features = ["build_advanced"] +``` + +## `build_full` + +**Enables features:** `build`, `comp`, `pathf`, `dispatch_tree` + +**Positioning:** Full build-time configuration, extends `build_advanced` with the path analyzer (`pathf`) to automatically resolve type module paths, suitable for projects with complex structures that require automated build-time analysis. + +> [!NOTE] +> +> This feature group is intended for **build dependencies** only and must be used alongside the `full` feature. Enable it in the `[build-dependencies]` section of `Cargo.toml`: + +```toml +[dependencies.mingling] +features = ["full"] + +[build-dependencies.mingling] +features = ["build_full"] +``` + +# Feature Details + ## Feature `all_serde_fmt` **Description:** @@ -83,7 +143,7 @@ When enabled, Mingling **at compile time** hard-codes the subcommand structure a See [example](https://mingling-rs.github.io/mingling/docs/example-viewer.html?name=example-dispatch-tree) -## Feature `extra_macros` +## Feature `extras` **Description:** @@ -106,7 +166,7 @@ For example, allows the shorthand form `dispatcher!("greet")`, which auto-genera ### `empty_result!()` ```rust -// Features: ["extra_macros"] +// Features: ["extras"] pack!(StatePrev1 = ()); pack!(StatePrev2 = ()); @@ -134,8 +194,8 @@ fn handle_state_prev1(_p: StatePrev1) -> Next { ### `#[program_setup]` ```rust -// Features: ["extra_macros"] -use mingling::{macros::program_setup, Program}; +// Features: ["extras"] +use mingling::{ErrorOutput, macros::program_setup, Program}; fn main() { let mut program = ThisProgram::new(); @@ -146,7 +206,7 @@ fn main() { #[program_setup] fn no_error_setup(program: &mut Program<ThisProgram>) { program.global_flag(["--no-error"], |program| { - program.stdout_setting.error_output = false; + program.stdout_setting.error_output = ErrorOutput::Hide; }); } ``` @@ -154,7 +214,7 @@ fn no_error_setup(program: &mut Program<ThisProgram>) { ### `entry!` ```rust -// Features: ["extra_macros"] +// Features: ["extras"] use mingling::macros::entry; pack!(EntryHello = Vec<String>); @@ -174,7 +234,7 @@ Registers an external type as a member of the program group without modifying it The type's simple name is used as the enum variant, just like `pack!` or `#[derive(Grouped)]`. ```rust -// Features: ["extra_macros"] +// Features: ["extras"] use mingling::macros::group; use std::num::ParseIntError; @@ -189,7 +249,7 @@ Creates an error struct with an automatic `name: String` field set to the snake_ of the struct name. Optionally wraps an inner type for additional context. ```rust -// Features: ["extra_macros"] +// Features: ["extras"] use std::path::PathBuf; // Simple form — only a name field: |
