diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-05-02 01:02:23 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-05-02 01:25:06 +0800 |
| commit | 11a3258834587a267f63588366ecc00d6b82156c (patch) | |
| tree | 9a7d2db5daa52a5f4de2a9d946c8f15438ab89d3 /mingling_macros/src/dispatcher_clap.rs | |
| parent | f31347533c2b13f58eeae29ffc3910ca5e2f04d5 (diff) | |
Add architecture overview and doc comments to macro crate
Diffstat (limited to 'mingling_macros/src/dispatcher_clap.rs')
| -rw-r--r-- | mingling_macros/src/dispatcher_clap.rs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/mingling_macros/src/dispatcher_clap.rs b/mingling_macros/src/dispatcher_clap.rs index 06f2c5a..37c662f 100644 --- a/mingling_macros/src/dispatcher_clap.rs +++ b/mingling_macros/src/dispatcher_clap.rs @@ -1,42 +1,3 @@ -//! Dispatcher Clap Attribute Macro -//! -//! This module provides the `#[dispatcher_clap(...)]` attribute macro for -//! automatically generating a `Dispatcher` implementation that uses `clap::Parser` -//! to parse command arguments into the annotated struct. -//! -//! This macro is only available when the `clap` feature is enabled. -//! -//! # Syntax -//! -//! ```rust,ignore -//! #[derive(Groupped, clap::Parser)] -//! #[dispatcher_clap("command_name", DispatcherName)] -//! struct MyEntry { -//! #[arg(long, short)] -//! name: String, -//! } -//! ``` -//! -//! Or with explicit program name: -//! -//! ```rust,ignore -//! #[dispatcher_clap(MyProgram, "ok", CommandOk, error = CommandParseError)] -//! struct OkEntry { -//! #[arg(long, short)] -//! str: String, -//! } -//! ``` -//! -//! Or with help: -//! -//! ```rust,ignore -//! #[dispatcher_clap("ok", CommandOk, error = CommandParseError, help = true)] -//! struct OkEntry { -//! #[arg(long, short)] -//! str: String, -//! } -//! ``` - use proc_macro::TokenStream; use quote::quote; use syn::{ |
