File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ pub fn extractor_cli_config(_attr: TokenStream, item: TokenStream) -> TokenStrea
19
19
. fields
20
20
. iter ( )
21
21
. map ( |f| {
22
- if get_type_tip ( & f. ty ) . is_some_and ( |i| i == "Vec" ) {
22
+ if f. ident . as_ref ( ) . is_some_and ( |i| i != "inputs" )
23
+ && get_type_tip ( & f. ty ) . is_some_and ( |i| i == "Vec" )
24
+ {
23
25
quote ! {
24
26
#[ serde( deserialize_with="deserialize_newline_or_comma_separated" ) ]
25
27
#f
@@ -38,19 +40,17 @@ pub fn extractor_cli_config(_attr: TokenStream, item: TokenStream) -> TokenStrea
38
40
let ty = & f. ty ;
39
41
let type_tip = get_type_tip ( ty) ;
40
42
if type_tip. is_some_and ( |i| i == "bool" ) {
41
- return quote ! {
43
+ quote ! {
42
44
#[ arg( long) ]
43
45
#[ serde( skip_serializing_if="<&bool>::not" ) ]
44
46
#id: bool
45
- } ;
46
- }
47
- if type_tip. is_some_and ( |i| i == "Option" ) {
48
- return quote ! {
47
+ }
48
+ } else if type_tip. is_some_and ( |i| i == "Option" ) {
49
+ quote ! {
49
50
#[ arg( long) ]
50
51
#f
51
- } ;
52
- }
53
- if id == & format_ident ! ( "verbose" ) {
52
+ }
53
+ } else if id == & format_ident ! ( "verbose" ) {
54
54
quote ! {
55
55
#[ arg( long, short, action=clap:: ArgAction :: Count ) ]
56
56
#[ serde( skip_serializing_if="u8::is_zero" ) ]
@@ -60,6 +60,11 @@ pub fn extractor_cli_config(_attr: TokenStream, item: TokenStream) -> TokenStrea
60
60
quote ! {
61
61
#f
62
62
}
63
+ } else if type_tip. is_some_and ( |i| i == "Vec" ) {
64
+ quote ! {
65
+ #[ arg( long) ]
66
+ #id: Option <String >
67
+ }
63
68
} else {
64
69
quote ! {
65
70
#[ arg( long) ]
You can’t perform that action at this time.
0 commit comments