diff options
author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2022-09-01 11:52:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 11:52:11 +0200 |
commit | cbd830771073e5cb64b4984bf6a1bc21a90812e0 (patch) | |
tree | bf74968199cdb7d17a89df01825fff16db1afdd7 | |
parent | b8933b1b5693bc0d59febfae4b9db5f4558be071 (diff) |
fix(check): --remote and --no-remote should be mutually exclusive (#14964)
-rw-r--r-- | cli/args/flags.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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] |