diff options
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 0ce521296..44bb0dde1 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -2394,6 +2394,8 @@ fn publish_subcommand() -> Command { .help("Allow publishing with slow types") .action(ArgAction::SetTrue), ) + .arg(check_arg(/* type checks by default */ true)) + .arg(no_check_arg()) }) } @@ -3823,6 +3825,9 @@ fn vendor_parse(flags: &mut Flags, matches: &mut ArgMatches) { } fn publish_parse(flags: &mut Flags, matches: &mut ArgMatches) { + flags.type_check_mode = TypeCheckMode::Local; // local by default + no_check_arg_parse(flags, matches); + check_arg_parse(flags, matches); config_args_parse(flags, matches); flags.subcommand = DenoSubcommand::Publish(PublishFlags { @@ -8542,4 +8547,27 @@ mod tests { let r = flags_from_vec(svec!["deno", "jupyter", "--install", "--kernel",]); r.unwrap_err(); } + + #[test] + fn publish_args() { + let r = flags_from_vec(svec![ + "deno", + "publish", + "--dry-run", + "--allow-slow-types", + "--token=asdf", + ]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Publish(PublishFlags { + token: Some("asdf".to_string()), + dry_run: true, + allow_slow_types: true, + }), + type_check_mode: TypeCheckMode::Local, + ..Flags::default() + } + ); + } } |