diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-13 08:39:08 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-13 08:39:08 +0800 |
| commit | 5e59dd5e58a14659cd557dc43d6f5176a13fee9e (patch) | |
| tree | 44e31230fbdc59dc4e1e14961bbb42b2d00d9327 /mingling/src | |
| parent | 8243a48dc00233c9e5911ce278e75d123305cf90 (diff) | |
Add test tool for examples and update exit code demo
Diffstat (limited to 'mingling/src')
| -rw-r--r-- | mingling/src/example_docs.rs | 7 |
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!(); |
