diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-24 12:01:38 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-24 12:01:38 +0800 |
| commit | 1d1baf75a3acb5eb32913a8bdad42bae42844aa2 (patch) | |
| tree | 5dafbcbce48a5de3c61bba0c7d309e97dd80b1ce /mling | |
| parent | addfbbf0b33a6251605990da73c2de5131766827 (diff) | |
Redesign hook system with structured info types and ProgramControls
Diffstat (limited to 'mling')
| -rw-r--r-- | mling/src/cli.rs | 6 |
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); |
