aboutsummaryrefslogtreecommitdiff
path: root/examples/example-combine-pathf-dispatch-tree/src/main.rs
blob: 98b3e4c844d4a529fb0805936d4676dd616056da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//! Example: Combining pathf + dispatch_tree
//!
//! > This example demonstrates how to use `pathf` and `dispatch_tree` together.
//! > Types are defined in a submodule (`sub`), and `gen_program!()` resolves
//! > them automatically via pathf without explicit `use` imports.
//! >
//! > **Important**: `dispatch_tree` must be enabled in BOTH `[dependencies]`
//! > AND `[build-dependencies]` so that pathf's builder can detect
//! > `__internal_dispatcher_*` types needed by the dispatch tree.
//! >
//! > Also requires `extra_macros` for the implicit `dispatcher!("hello")` form.
//!
//! Run:
//! ```bash
//! cargo run --manifest-path examples/example-combine-pathf-dispatch-tree/Cargo.toml --quiet -- hello Alice
//! ```
//!
//! Output:
//! ```plaintext
//! Hello, Alice!
//! ```

mod sub;

use mingling::macros::gen_program;

fn main() {
    ThisProgram::new().exec_and_exit();
}

gen_program!();