1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-18 03:44:05 -05:00

fix(check): --remote and --no-remote should be mutually exclusive (#14964)

This commit is contained in:
Geert-Jan Zwiers 2022-09-01 11:52:11 +02:00 committed by GitHub
parent b8933b1b56
commit cbd8307710
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -754,6 +754,7 @@ fn check_subcommand<'a>() -> Command<'a> {
Arg::new("remote") Arg::new("remote")
.long("remote") .long("remote")
.help("Type-check all modules, including remote") .help("Type-check all modules, including remote")
.conflicts_with("no-remote")
) )
.arg( .arg(
Arg::new("file") Arg::new("file")
@ -3835,6 +3836,15 @@ mod tests {
..Flags::default() ..Flags::default()
} }
); );
let r = flags_from_vec(svec![
"deno",
"check",
"--remote",
"--no-remote",
"script.ts"
]);
assert_eq!(r.unwrap_err().kind(), clap::ErrorKind::ArgumentConflict);
} }
#[test] #[test]