From 69e5fd86b4532d3dfa7c503f74d42a64a845d57e Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 30 Jun 2026 04:45:04 +0800 Subject: fix(mingling_pathf): extract CMD, error, and help types from dispatcher_clap --- .../test/src/test_files/test_dispatcher_clap.rs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'mingling_pathf/test/src/test_files') diff --git a/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs b/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs index 0ba884d..33d86e0 100644 --- a/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs +++ b/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs @@ -1,3 +1,4 @@ +// Basic: entry type only (no CMD type specified) #[mingling::macros::dispatcher_clap] struct EntryClap1 { name: String, @@ -20,6 +21,30 @@ pub struct EntryClap4 { value: i32, } +// With CMD type +#[dispatcher_clap("greet", CMDGreet)] +struct EntryWithCmd { + name: String, +} + +// With CMD + error +#[dispatcher_clap("delete", CMDDelete, error = ErrorDelete)] +struct EntryWithError { + id: u64, +} + +// With CMD + help +#[dispatcher_clap("helpcmd", CMDHelp, help = true)] +struct EntryWithHelp { + verbose: bool, +} + +// With CMD + error + help +#[dispatcher_clap("full", CMDFull, error = ErrorFull, help = true)] +struct EntryFull { + all: bool, +} + pub mod sub { #[mingling::macros::dispatcher_clap] struct EntryClap1 { @@ -30,4 +55,19 @@ pub mod sub { struct EntryClap3 { value: String, } + + #[dispatcher_clap("greet", CMDGreet)] + struct EntryWithCmd { + name: String, + } + + #[dispatcher_clap("delete", CMDDelete, error = ErrorDelete)] + struct EntryWithError { + id: u64, + } + + #[dispatcher_clap("helpcmd", CMDHelp, help = true)] + struct EntryWithHelp { + verbose: bool, + } } -- cgit