diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-10-20 14:10:42 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 14:10:42 +1100 |
commit | 57e95032c898cfdfe795e6924d402fdbe2ae59a8 (patch) | |
tree | e548b283d0129b5a1c00828f5a456cc094276bd1 /cli/flags.rs | |
parent | 034ab48086557af00216ffe311c71ad4eb0ec4d5 (diff) |
feat(cli): add support for bundle --no-check (#8023)
Fixes #6686
Diffstat (limited to 'cli/flags.rs')
-rw-r--r-- | cli/flags.rs | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index 0f55b370f..63bad9f14 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -402,14 +402,7 @@ fn install_parse(flags: &mut Flags, matches: &clap::ArgMatches) { } fn bundle_parse(flags: &mut Flags, matches: &clap::ArgMatches) { - // TODO(nayeemrmn): Replace the next couple lines with `compile_args_parse()` - // once `deno bundle --no-check` is supported. - importmap_arg_parse(flags, matches); - no_remote_arg_parse(flags, matches); - config_arg_parse(flags, matches); - reload_arg_parse(flags, matches); - lock_args_parse(flags, matches); - ca_file_arg_parse(flags, matches); + compile_args_parse(flags, matches); let source_file = matches.value_of("source_file").unwrap().to_string(); @@ -776,16 +769,7 @@ These must be added to the path manually if required.") } fn bundle_subcommand<'a, 'b>() -> App<'a, 'b> { - SubCommand::with_name("bundle") - // TODO(nayeemrmn): Replace the next couple lines with `compile_args()` once - // `deno bundle --no-check` is supported. - .arg(importmap_arg()) - .arg(no_remote_arg()) - .arg(config_arg()) - .arg(reload_arg()) - .arg(lock_arg()) - .arg(lock_write_arg()) - .arg(ca_file_arg()) + compile_args(SubCommand::with_name("bundle")) .arg( Arg::with_name("source_file") .takes_value(true) @@ -2354,6 +2338,24 @@ mod tests { } #[test] + fn bundle_nocheck() { + let r = + flags_from_vec_safe(svec!["deno", "bundle", "--no-check", "script.ts"]) + .unwrap(); + assert_eq!( + r, + Flags { + subcommand: DenoSubcommand::Bundle { + source_file: "script.ts".to_string(), + out_file: None, + }, + no_check: true, + ..Flags::default() + } + ); + } + + #[test] fn run_importmap() { let r = flags_from_vec_safe(svec![ "deno", |