diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2024-04-24 13:34:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 20:34:21 +0000 |
commit | 5a7414e16349d6872a94db38955bf89edf621c30 (patch) | |
tree | 0af8e39dd5fb395daac578deed33fae72f56f496 /cli/args/flags.rs | |
parent | ac71d876d7c9e3fec65e4739540bc60c8d75ee9a (diff) |
chore: update deno_doc (#23544)
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 71398d355..fd64a6940 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -127,7 +127,7 @@ impl Default for DocSourceFileFlag { #[derive(Clone, Debug, Eq, PartialEq)] pub struct DocHtmlFlag { - pub name: String, + pub name: Option<String>, pub output: String, } @@ -1695,7 +1695,6 @@ Show documentation for runtime built-ins: .long("name") .help("The name that will be displayed in the docs") .action(ArgAction::Set) - .required_if_eq("html", "true") .require_equals(true) ) .arg( @@ -3690,7 +3689,7 @@ fn doc_parse(flags: &mut Flags, matches: &mut ArgMatches) { let json = matches.get_flag("json"); let filter = matches.remove_one::<String>("filter"); let html = if matches.get_flag("html") { - let name = matches.remove_one::<String>("name").unwrap(); + let name = matches.remove_one::<String>("name"); let output = matches .remove_one::<String>("output") .unwrap_or(String::from("./docs/")); @@ -8353,7 +8352,7 @@ mod tests { ); let r = flags_from_vec(svec!["deno", "doc", "--html", "path/to/module.ts"]); - assert!(r.is_err()); + assert!(r.is_ok()); let r = flags_from_vec(svec![ "deno", @@ -8370,7 +8369,7 @@ mod tests { json: false, lint: false, html: Some(DocHtmlFlag { - name: "My library".to_string(), + name: Some("My library".to_string()), output: String::from("./docs/"), }), source_files: DocSourceFileFlag::Paths(svec!["path/to/module.ts"]), @@ -8396,7 +8395,7 @@ mod tests { private: false, json: false, html: Some(DocHtmlFlag { - name: "My library".to_string(), + name: Some("My library".to_string()), output: String::from("./foo"), }), lint: true, |