aboutsummaryrefslogtreecommitdiff
path: root/mingling/src/example_docs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling/src/example_docs.rs')
-rw-r--r--mingling/src/example_docs.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs
index 5ea04b1..f77d9f6 100644
--- a/mingling/src/example_docs.rs
+++ b/mingling/src/example_docs.rs
@@ -1108,10 +1108,16 @@ pub mod example_error_handling {}
///
/// Source code (./src/main.rs)
/// ```ignore
-/// use mingling::{prelude::*, res::ResExitCode, setup::ExitCodeSetup};
+/// use mingling::{
+/// macros::help,
+/// prelude::*,
+/// res::ResExitCode,
+/// setup::{BasicProgramSetup, ExitCodeSetup},
+/// };
///
/// fn main() {
/// let mut program = ThisProgram::new();
+/// program.with_setup(BasicProgramSetup);
///
/// // --------- IMPORTANT ---------
/// // Register `ExitCodeSetup` for the program to enable exit codes
@@ -1144,6 +1150,12 @@ pub mod example_error_handling {}
/// r_println!("Hello, {}", *name);
/// }
///
+/// #[help]
+/// fn help_hello(_p: EntryHello, ec: &mut ResExitCode) {
+/// r_println!("Usage: hello <NAME>");
+/// ec.exit_code = 2;
+/// }
+///
/// // Define renderer, render error message _______________ Inject exit code resource
/// // /
/// /// Renders the error when no name is provided |