1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00

fix(doc): require source files if --html or --lint used (#21072)

Fixes https://github.com/denoland/deno/issues/21067
Fixes https://github.com/denoland/deno/issues/21070
This commit is contained in:
Bartek Iwańczuk 2023-11-03 18:06:18 +01:00 committed by GitHub
parent 76fbe85264
commit ee1e9a6434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1480,7 +1480,8 @@ Show documentation for runtime built-ins:
Arg::new("source_file")
.num_args(1..)
.action(ArgAction::Append)
.value_hint(ValueHint::FilePath),
.value_hint(ValueHint::FilePath)
.required_if_eq_any([("html", "true"), ("lint", "true")]),
)
})
}
@ -7541,6 +7542,10 @@ mod tests {
}
);
let r =
flags_from_vec(svec!["deno", "doc", "--html", "--name=My library",]);
assert!(r.is_err());
let r = flags_from_vec(svec![
"deno",
"doc",
@ -7677,6 +7682,9 @@ mod tests {
}
);
let r = flags_from_vec(svec!["deno", "doc", "--lint",]);
assert!(r.is_err());
let r = flags_from_vec(svec![
"deno",
"doc",