diff options
Diffstat (limited to 'examples/example-implicit-dispatcher/src/main.rs')
| -rw-r--r-- | examples/example-implicit-dispatcher/src/main.rs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/examples/example-implicit-dispatcher/src/main.rs b/examples/example-implicit-dispatcher/src/main.rs index 340d585..89a5ec3 100644 --- a/examples/example-implicit-dispatcher/src/main.rs +++ b/examples/example-implicit-dispatcher/src/main.rs @@ -4,20 +4,13 @@ use mingling::prelude::*; -// When using implicit syntax, the entry and dispatcher names will be automatically derived -dispatcher!("remote.add" /*, CMDRemoteAdd => EntryRemoteAdd */); -dispatcher!("remote.remove", CMDRemoteRemove => EntryRemoteRemove); +// When using implicit syntax, the entry name will be automatically derived +// from the command name (the dispatcher struct is generated internally) +dispatcher!("remote.add" /* => EntryRemoteAdd */); +dispatcher!("remote.remove", EntryRemoteRemove); fn main() { - let mut program = ThisProgram::new(); - - // --------- IMPORTANT --------- - program.with_dispatcher(CMDRemoteAdd); - // ^^^^^^^^^^^^\_ CMDRemoteAdd is implicitly created - // --------- IMPORTANT --------- - - program.with_dispatcher(CMDRemoteRemove); - program.exec_and_exit(); + ThisProgram::new().exec_and_exit(); } gen_program!(); |
