diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-28 19:11:14 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-28 19:11:14 +0800 |
| commit | 2dff21cc78fd2d6a4fa4f227f6ad94e3f7baa943 (patch) | |
| tree | de694a2d34a6dd60b08d6da31c4f27fcd5eec416 /mingling_pathf/src/patterns.rs | |
| parent | bf35af6bbf30492bcd23eb6103fdac3382dd6d33 (diff) | |
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<String>`
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.
Diffstat (limited to 'mingling_pathf/src/patterns.rs')
| -rw-r--r-- | mingling_pathf/src/patterns.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mingling_pathf/src/patterns.rs b/mingling_pathf/src/patterns.rs index 9845b73..964fe7c 100644 --- a/mingling_pathf/src/patterns.rs +++ b/mingling_pathf/src/patterns.rs @@ -2,6 +2,7 @@ pub use basic_struct::*; pub use chain::*; +pub use command::*; pub use completion::*; pub use dispatcher::*; pub use dispatcher_clap::*; @@ -13,6 +14,7 @@ pub use renderer::*; mod basic_struct; mod chain; +mod command; mod completion; mod dispatcher; mod dispatcher_clap; |
