Skip to content
This repository was archived by the owner on May 20, 2020. It is now read-only.

Commit dd91212

Browse files
committed
Do not check subcommands for moved flags
In b864a9e, the check for moved flags was using `is_present` which checks flags in subcommands. This caused a lot of false positives. Instead, look at the args at the top level only and check if the flag exists there.
1 parent 07801eb commit dd91212

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,10 @@ fn check_moved_flags(matches: &ArgMatches) -> Result<()> {
235235
("target", build_msg),
236236
("sysroot", build_msg),
237237
("test", "Use in conjunction with the test subcommand."),
238-
("test", "Use the test subcommand."),
239238
];
240239

241240
for &(flag, err_msg) in moved_flags.iter() {
242-
if matches.is_present(flag) {
241+
if matches.args.contains_key(flag) {
243242
return Err(error::MovedFlag {
244243
flag_name: flag.to_string(),
245244
msg: err_msg.to_string(),

0 commit comments

Comments
 (0)