Skip to content

Commit 32ac67f

Browse files
committed
Fix clap argument handling
1 parent fca789d commit 32ac67f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/main.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ fn parse_args() -> Args {
112112
} else {
113113
vec!["clear-cache", "list-templates"]
114114
})
115-
.number_of_values(1)
116115
.conflicts_with_all(if cfg!(windows) {
117116
&["list-templates", "install-file-association", "uninstall-file-association"]
118117
} else {
@@ -124,7 +123,6 @@ fn parse_args() -> Args {
124123
.about("Arguments for the script to execute.")
125124
.multiple_values(true)
126125
.min_values(0)
127-
.last(true)
128126
)
129127
.arg(Arg::new("expr")
130128
.about("Execute <script> as a literal expression and display the result.")
@@ -166,23 +164,23 @@ fn parse_args() -> Args {
166164
.long("dep")
167165
.short('d')
168166
.takes_value(true)
169-
.multiple_values(true)
167+
.multiple_occurrences(true)
170168
.number_of_values(1)
171169
)
172170
.arg(Arg::new("dep_extern")
173171
.about("Like `dep`, except that it *also* adds a `#[macro_use] extern crate name;` item for expression and loop scripts. Note that this only works if the name of the dependency and the name of the library it generates are exactly the same.")
174172
.long("dep-extern")
175173
.short('D')
176174
.takes_value(true)
177-
.multiple_values(true)
175+
.multiple_occurrences(true)
178176
.requires("expr_or_loop")
179177
)
180178
.arg(Arg::new("extern")
181179
.about("Adds an `#[macro_use] extern crate name;` item for expressions and loop scripts.")
182180
.long("extern")
183181
.short('x')
184182
.takes_value(true)
185-
.multiple_values(true)
183+
.multiple_occurrences(true)
186184
.requires("expr_or_loop")
187185
)
188186
.arg(Arg::new("features")
@@ -195,7 +193,7 @@ fn parse_args() -> Args {
195193
.long("unstable-feature")
196194
.short('u')
197195
.takes_value(true)
198-
.multiple_values(true)
196+
.multiple_occurrences(true)
199197
.requires("expr_or_loop")
200198
)
201199

0 commit comments

Comments
 (0)