diff options
Diffstat (limited to 'examples/example-exit-code/src')
| -rw-r--r-- | examples/example-exit-code/src/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/example-exit-code/src/main.rs b/examples/example-exit-code/src/main.rs index f62ad22..1fe5424 100644 --- a/examples/example-exit-code/src/main.rs +++ b/examples/example-exit-code/src/main.rs @@ -13,7 +13,7 @@ use mingling::{ macros::{chain, dispatcher, gen_program, pack, r_println, renderer}, - res::update_exit_code, + res::{exit_code, update_exit_code}, setup::ExitCodeSetup, }; @@ -21,7 +21,7 @@ fn main() { 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); @@ -35,7 +35,8 @@ fn handle_error_entry(_prev: ErrorEntry) -> NextProcess { #[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!(); |
