From ec6c87d12062576271231b88364a4aa00765ae65 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 15 Aug 2026 03:28:02 +0800 Subject: feat(core): allow pre_dispatch hooks to mutate arguments Change `HookPreDispatchInfo.arguments` from `&[String]` to `&mut Vec` so hooks can rewrite command-line arguments before dispatch. --- mingling_core/src/program/hook/hook_info.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mingling_core/src/program/hook') diff --git a/mingling_core/src/program/hook/hook_info.rs b/mingling_core/src/program/hook/hook_info.rs index 768f652..25cf272 100644 --- a/mingling_core/src/program/hook/hook_info.rs +++ b/mingling_core/src/program/hook/hook_info.rs @@ -7,7 +7,10 @@ pub struct HookBeginInfo {} /// Represents the data passed to `pre_dispatch` hook. pub struct HookPreDispatchInfo<'a> { /// Arguments entered by the user before dispatching - pub arguments: &'a [String], + /// + /// The reference is mutable so the hook can rewrite the arguments before + /// they are matched against the registered dispatchers. + pub arguments: &'a mut Vec, } /// Represents the data passed to `post_dispatch` hook. -- cgit