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:
parent
76fbe85264
commit
ee1e9a6434
1 changed files with 9 additions and 1 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue