From 5a7414e16349d6872a94db38955bf89edf621c30 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 24 Apr 2024 13:34:21 -0700 Subject: chore: update deno_doc (#23544) --- cli/args/flags.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'cli/args') 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, 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::("filter"); let html = if matches.get_flag("html") { - let name = matches.remove_one::("name").unwrap(); + let name = matches.remove_one::("name"); let output = matches .remove_one::("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, -- cgit v1.2.3