aboutsummaryrefslogtreecommitdiff
path: root/mling/src/cli.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-24 12:01:38 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-24 12:01:38 +0800
commit1d1baf75a3acb5eb32913a8bdad42bae42844aa2 (patch)
tree5dafbcbce48a5de3c61bba0c7d309e97dd80b1ce /mling/src/cli.rs
parentaddfbbf0b33a6251605990da73c2de5131766827 (diff)
Redesign hook system with structured info types and ProgramControls
Diffstat (limited to 'mling/src/cli.rs')
-rw-r--r--mling/src/cli.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/mling/src/cli.rs b/mling/src/cli.rs
index 123cca3..a6d099b 100644
--- a/mling/src/cli.rs
+++ b/mling/src/cli.rs
@@ -39,7 +39,8 @@ pub fn run() {
});
// Intercept Help
- program.with_hook(ProgramHook::empty().on_post_dispatch(|c| match c {
+ program.with_hook(
+ ProgramHook::empty().on_post_dispatch(|info| match info.entry {
// When dispatcher is not found
ThisProgram::ErrorDispatcherNotFound
// And user requests Help
@@ -49,7 +50,8 @@ pub fn run() {
exit(0)
}
_ => {}
- }));
+ }),
+ );
// Commands
program.with_dispatcher(CMDCompletion);