aboutsummaryrefslogtreecommitdiff
path: root/examples/example-pathfinder/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/example-pathfinder/src/main.rs')
-rw-r--r--examples/example-pathfinder/src/main.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/example-pathfinder/src/main.rs b/examples/example-pathfinder/src/main.rs
new file mode 100644
index 0000000..0f93a8d
--- /dev/null
+++ b/examples/example-pathfinder/src/main.rs
@@ -0,0 +1,30 @@
+//! Example: Module Pathfinder (pathf)
+//!
+//! > This example demonstrates how to use the `pathf` feature to define types
+//! > in submodules without needing explicit `use` in the main module.
+//! > All type paths are resolved automatically at build time.
+//!
+//! Run:
+//! ```bash
+//! cargo run --manifest-path examples/example-pathfinder/Cargo.toml --quiet -- greet
+//! cargo run --manifest-path examples/example-pathfinder/Cargo.toml --quiet -- greet Alice
+//! ```
+//!
+//! Output:
+//! ```plaintext
+//! Hello, World!
+//! Hello, Alice!
+//! ```
+
+mod sub;
+
+use mingling::macros::gen_program;
+use crate::sub::CMDGreet;
+
+fn main() {
+ let mut program = ThisProgram::new();
+ program.with_dispatcher(CMDGreet);
+ program.exec_and_exit();
+}
+
+gen_program!();