summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
authorValentin Anger <syrupthinker@gryphno.de>2020-10-12 01:05:46 +0200
committerGitHub <noreply@github.com>2020-10-12 10:05:46 +1100
commitfede13f2eb64f648e6c39aa01e2e0ede4e5be25e (patch)
tree98c81ab03833c1cc9d9d1f163dce4a8ff5c19b06 /cli/flags.rs
parent5f3028af13c25fb3af8f36d3d5913ef0688e5ce7 (diff)
feat(cli): support importmap flag with deno doc subcommand (#7821)
Fixes #7783
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"]);