summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
authorWilliam Perron <william.perron@live.ca>2020-09-21 09:07:19 -0400
committerGitHub <noreply@github.com>2020-09-21 15:07:19 +0200
commit42772845f6dde1b27a9e55c7738743388350f2b2 (patch)
tree73df54b336a34db95aa2e9c777cb1ea4f151125a /cli/flags.rs
parente06875e9f7e4b3365b9f30322e3e5307903feed4 (diff)
fix(info): add --importmap flag (#7424)
Diffstat (limited to 'cli/flags.rs')
-rw-r--r--cli/flags.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index 4d08b0c77..63d4c15e0 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -478,6 +478,7 @@ fn eval_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
fn info_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
reload_arg_parse(flags, matches);
+ importmap_arg_parse(flags, matches);
ca_file_arg_parse(flags, matches);
let json = matches.is_present("json");
flags.subcommand = DenoSubcommand::Info {
@@ -884,6 +885,7 @@ TypeScript compiler cache: Subdirectory containing TS compiler output.",
.arg(ca_file_arg())
// TODO(lucacasonato): remove for 2.0
.arg(no_check_arg().hidden(true))
+ .arg(importmap_arg())
.arg(
Arg::with_name("json")
.long("json")
@@ -2376,6 +2378,27 @@ mod tests {
}
#[test]
+ fn info_importmap() {
+ let r = flags_from_vec_safe(svec![
+ "deno",
+ "info",
+ "--importmap=importmap.json",
+ "script.ts"
+ ]);
+ assert_eq!(
+ r.unwrap(),
+ Flags {
+ subcommand: DenoSubcommand::Info {
+ file: Some("script.ts".to_string()),
+ json: false,
+ },
+ import_map_path: Some("importmap.json".to_owned()),
+ ..Flags::default()
+ }
+ );
+ }
+
+ #[test]
fn cache_importmap() {
let r = flags_from_vec_safe(svec![
"deno",