From cbd830771073e5cb64b4984bf6a1bc21a90812e0 Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Thu, 1 Sep 2022 11:52:11 +0200 Subject: fix(check): --remote and --no-remote should be mutually exclusive (#14964) --- cli/args/flags.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cli') diff --git a/cli/args/flags.rs b/cli/args/flags.rs index a70b2c675..19dc5ce4b 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -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] -- cgit v1.2.3