From 2c5355555126cf0e5e6012fb22457638bce9bf4d Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 29 May 2026 16:49:35 +0800 Subject: Rename CompletionDispatcher to CMDCompletion and hide internal types --- mingling/src/example_docs.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'mingling/src/example_docs.rs') diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs index a7e8d2e..5b889ba 100644 --- a/mingling/src/example_docs.rs +++ b/mingling/src/example_docs.rs @@ -511,13 +511,13 @@ pub mod example_clap_binding {} /// program.with_dispatcher(CMDGreet); /// /// // --------- IMPORTANT --------- -/// // The `comp` feature makes `gen_program!()` generate a CompletionDispatcher automatically +/// // The `comp` feature makes `gen_program!()` generate a CMDCompletion automatically /// // It adds a hidden `__comp` subcommand for communication with the completion script -/// program.with_dispatcher(crate::CompletionDispatcher); +/// program.with_dispatcher(crate::CMDCompletion); /// // --------- IMPORTANT --------- /// /// // TIP: Note that the completion script reads stdout, -/// // so make sure no output is produced before the CompletionDispatcher is dispatched. +/// // so make sure no output is produced before the CMDCompletion is dispatched. /// program.exec_and_exit(); /// } /// @@ -568,7 +568,7 @@ pub mod example_clap_binding {} /// #[chain] /// fn handle_greet(args: EntryGreet) -> Next { /// let result: ResultName = args -/// .pick(["-r", "--repeat"]) +/// .pick_or(["-r", "--repeat"], 1) /// .pick_or((), "World") /// .unpack() /// .into(); @@ -843,8 +843,8 @@ pub mod example_dispatch_tree {} /// Source code (./src/main.rs) /// ```ignore /// use mingling::{ -/// EnumTag, Groupped, ShellContext, Suggest, macros::suggest_enum, parser::PickableEnum, -/// prelude::*, +/// macros::suggest_enum, parser::PickableEnum, prelude::*, EnumTag, Groupped, ShellContext, +/// Suggest, /// }; /// /// // Define the enum and derive the EnumTag trait @@ -883,7 +883,9 @@ pub mod example_dispatch_tree {} /// #[enum_desc("A general-purpose programming language with clean syntax, known for readability")] /// Python, /// -/// #[enum_desc("An object-oriented scripting language, famous for its concise and elegant syntax")] +/// #[enum_desc( +/// "An object-oriented scripting language, famous for its concise and elegant syntax" +/// )] /// Ruby, /// /// #[default] @@ -923,7 +925,7 @@ pub mod example_dispatch_tree {} /// /// fn main() { /// let mut program = ThisProgram::new(); -/// program.with_dispatcher(CompletionDispatcher); +/// program.with_dispatcher(CMDCompletion); /// program.with_dispatcher(CMDLanguageSelection); /// program.exec_and_exit(); /// } -- cgit