From 1d1baf75a3acb5eb32913a8bdad42bae42844aa2 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 24 Jun 2026 12:01:38 +0800 Subject: Redesign hook system with structured info types and ProgramControls --- mling/src/cli.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mling/src') 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); -- cgit