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 --- examples/example-completion/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/example-completion/src') diff --git a/examples/example-completion/src/main.rs b/examples/example-completion/src/main.rs index 7ca23b9..a34ccab 100644 --- a/examples/example-completion/src/main.rs +++ b/examples/example-completion/src/main.rs @@ -52,13 +52,13 @@ fn main() { 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(); } @@ -109,7 +109,7 @@ pack!(ResultName = (u8, String)); #[chain] fn handle_greet(args: EntryGreet) -> Next { let result: ResultName = args - .pick(["-r", "--repeat"]) + .pick_or(["-r", "--repeat"], 1) .pick_or((), "World") .unpack() .into(); -- cgit