1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -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")
.long("remote")
.help("Type-check all modules, including remote")
.conflicts_with("no-remote")
)
.arg(
Arg::new("file")
@ -3835,6 +3836,15 @@ mod tests {
..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]