From 7625655d474f6f12e04a11a067f87287badce9f2 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 25 Apr 2026 22:29:24 +0800 Subject: Complete clap_parser macro and update changelog, readme --- CHANGELOG.md | 18 ++++++++++++++++-- README.md | 2 +- docs/README.md | 2 +- docs/pages/3-features/5-clap-parser.md | 6 ++++++ 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 docs/pages/3-features/5-clap-parser.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dee222..d2ba927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,22 @@ #### Features: -1. Added function `new_with_args` to `Program` -2. Added function `dispatch_args_dynamic` to `Program` +1. **\[macros\]** Completed the `clap_parser` feature: **Mingling** now supports parsing input using `clap::Parser` + +```rust +#[derive(Groupped, clap::Parser)] +#[dispatcher_clap("your_cmd", YourClapCommand, YourCommandParseError)] +struct YourCommandEntry { + #[arg(long, short)] + str_param: String, + + #[arg(long, short)] + path_param: PathBuf, +} +``` + +2. **\[core\]** Added function `new_with_args` to `Program` +3. **\[core\]** Added function `dispatch_args_dynamic` to `Program` #### **BREAKING CHANGES**: diff --git a/README.md b/README.md index 41d9f2b..2ec3737 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ You can read the following docs to learn more about the `Mingling` framework: - [x] core: \[[0.1.4](https://docs.rs/mingling/0.1.4/mingling/)\] General Renderers *( Json, Yaml, Toml, Ron )* - [x] core: \[[0.1.5](https://docs.rs/mingling/0.1.5/mingling/)\] Completion *( Bash Zsh Fish Pwsh )* - [X] core: \[[0.1.6](https://docs.rs/mingling/0.1.6/mingling/)\] Smarter Completion Suggest Generation -- [ ] \[**0.1.7**\] Clap Parser Support +- [X] \[[0.1.6](https://docs.rs/mingling/0.1.7/mingling/)\] Clap Parser Support - [ ] core: \[**0.1.8**\] Faster Dispatcher - [ ] \[**0.1.9**\] Helpdoc Generation - [ ] core: \[**0.1.9**\] Debug Toolkits (InvokeStackDisplay ...) diff --git a/docs/README.md b/docs/README.md index 03e17dc..ba9aa6d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -152,7 +152,7 @@ You can read the following docs to learn more about the `Mingling` framework: - [x] core: \[[0.1.4](https://docs.rs/mingling/0.1.4/mingling/)\] General Renderers *( Json, Yaml, Toml, Ron )* - [x] core: \[[0.1.5](https://docs.rs/mingling/0.1.5/mingling/)\] Completion *( Bash Zsh Fish Pwsh )* - [X] core: \[[0.1.6](https://docs.rs/mingling/0.1.6/mingling/)\] Smarter Completion Suggest Generation -- [ ] \[**0.1.7**\] Clap Parser Support +- [X] \[[0.1.6](https://docs.rs/mingling/0.1.7/mingling/)\] Clap Parser Support - [ ] core: \[**0.1.8**\] Faster Dispatcher - [ ] \[**0.1.9**\] Helpdoc Generation - [ ] core: \[**0.1.9**\] Debug Toolkits (InvokeStackDisplay ...) diff --git a/docs/pages/3-features/5-clap-parser.md b/docs/pages/3-features/5-clap-parser.md new file mode 100644 index 0000000..5cb68e6 --- /dev/null +++ b/docs/pages/3-features/5-clap-parser.md @@ -0,0 +1,6 @@ +
+ Mingling's Features +
+ +--- -- cgit