summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/flags.rs')
-rw-r--r--cli/flags.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index 06fbafdc3..12d4e9bc6 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -634,6 +634,7 @@ fn upgrade_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
}
fn doc_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
+ importmap_arg_parse(flags, matches);
reload_arg_parse(flags, matches);
let source_file = matches.value_of("source_file").map(String::from);
@@ -978,6 +979,7 @@ Show documentation for runtime built-ins:
deno doc
deno doc --builtin Deno.Listener",
)
+ .arg(importmap_arg())
.arg(reload_arg())
.arg(
Arg::with_name("json")
@@ -2421,6 +2423,29 @@ mod tests {
}
#[test]
+ fn doc_importmap() {
+ let r = flags_from_vec_safe(svec![
+ "deno",
+ "doc",
+ "--importmap=importmap.json",
+ "script.ts"
+ ]);
+ assert_eq!(
+ r.unwrap(),
+ Flags {
+ subcommand: DenoSubcommand::Doc {
+ source_file: Some("script.ts".to_owned()),
+ private: false,
+ json: false,
+ filter: None,
+ },
+ import_map_path: Some("importmap.json".to_owned()),
+ ..Flags::default()
+ }
+ );
+ }
+
+ #[test]
fn cache_multiple() {
let r =
flags_from_vec_safe(svec!["deno", "cache", "script.ts", "script_two.ts"]);