Skip to content

Commit b9f3c16

Browse files
committed
Fix --clippy arg for fix
1 parent fefcca1 commit b9f3c16

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bin/cargo/commands/fix.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ pub fn cli() -> App {
7676
Arg::with_name("clippy")
7777
.long("clippy")
7878
.help("Get fix suggestions from clippy instead of rustc")
79-
.hidden(true),
79+
.hidden(true)
80+
.multiple(true)
81+
.min_values(0)
82+
.number_of_values(1),
8083
)
8184
.after_help(
8285
"\
@@ -134,11 +137,13 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
134137
let use_clippy = args.is_present("clippy");
135138

136139
let clippy_args = args
137-
.value_of("clippy") // always yields None
140+
.value_of("clippy")
138141
.map(|s| s.split(' ').map(|s| s.to_string()).collect())
139142
.or_else(|| Some(vec![]))
140143
.filter(|_| use_clippy);
141144

145+
// dbg!(&clippy_args, use_clippy);
146+
142147
if use_clippy && !config.cli_unstable().unstable_options {
143148
return Err(failure::format_err!(
144149
"`cargo fix --clippy` is unstable, pass `-Z unstable-options` to enable it"

0 commit comments

Comments
 (0)