aboutsummaryrefslogtreecommitdiff
path: root/mingling/src/example_docs.rs
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-13 08:39:08 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-13 08:39:08 +0800
commit5e59dd5e58a14659cd557dc43d6f5176a13fee9e (patch)
tree44e31230fbdc59dc4e1e14961bbb42b2d00d9327 /mingling/src/example_docs.rs
parent8243a48dc00233c9e5911ce278e75d123305cf90 (diff)
Add test tool for examples and update exit code demo
Diffstat (limited to 'mingling/src/example_docs.rs')
-rw-r--r--mingling/src/example_docs.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs
index 1669344..ba61f92 100644
--- a/mingling/src/example_docs.rs
+++ b/mingling/src/example_docs.rs
@@ -371,7 +371,7 @@ pub mod example_dispatch_tree {}
/// ```ignore
/// use mingling::{
/// macros::{chain, dispatcher, gen_program, pack, r_println, renderer},
-/// res::update_exit_code,
+/// res::{exit_code, update_exit_code},
/// setup::ExitCodeSetup,
/// };
///
@@ -379,7 +379,7 @@ pub mod example_dispatch_tree {}
/// let mut program = ThisProgram::new();
/// program.with_dispatcher(ErrorCommand);
/// program.with_setup(ExitCodeSetup::<ThisProgram>::default());
-/// program.exec();
+/// program.exec_and_exit();
/// }
///
/// dispatcher!("error", ErrorCommand => ErrorEntry);
@@ -393,7 +393,8 @@ pub mod example_dispatch_tree {}
///
/// #[renderer]
/// fn render_error(_prev: ResultError) {
-/// r_println!("Error!");
+/// let exit_code = exit_code::<ThisProgram>();
+/// r_println!("Exit with exit code: {}", exit_code);
/// }
///
/// gen_program!();