From 2dff21cc78fd2d6a4fa4f227f6ad94e3f7baa943 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 28 Jul 2026 19:11:14 +0800 Subject: feat(mingling_macros, mingling_pathf): add `#[command]` attribute macro Add a new `#[command]` attribute macro (feature-gated behind `extra_macros`) that converts a plain function with a `Vec` parameter into a fully wired Mingling command. The macro generates a `dispatcher!` call, a `#[chain]` wrapper, and a hidden module re-exporting all generated types. Also add `CommandPattern` to the pathf pattern analyzer to recognize `#[command]`-annotated functions and track their generated hidden modules. --- mingling_macros/src/attr.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mingling_macros/src/attr.rs') diff --git a/mingling_macros/src/attr.rs b/mingling_macros/src/attr.rs index ed7f58b..8c17878 100644 --- a/mingling_macros/src/attr.rs +++ b/mingling_macros/src/attr.rs @@ -1,4 +1,6 @@ pub(crate) mod chain; +#[cfg(feature = "extra_macros")] +pub(crate) mod command; #[cfg(feature = "comp")] pub(crate) mod completion; #[cfg(feature = "clap")] -- cgit