diff options
author | Kira <cyra@cyra.pink> | 2023-08-13 04:04:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-13 04:04:17 +0200 |
commit | ca9ba87d9956e3f940e0116866e19461f008390b (patch) | |
tree | 233b47e68d3b90354556ff4ed47a8b0d2a944379 /ext/fetch/20_headers.js | |
parent | babfba14ef327051a1caf9df6730606330ff1cc0 (diff) |
fix(cli) error gracefully when script arg is not present and `--v8-flags` is present in `deno run` (#20145)
Fix #20022, fix #19627 (duplicate)
#17333 upgraded clap from version 3.1 to version 4. clap version 3.2.0
(intentionally) broke a behavior that deno was relying on to make `deno
run --v8-flags=--help` work without specifying a file, see
clap-rs/clap#3793. The workaround was to make the script argument
required _unless_ `--v8-flags` is present. This broke the expectation
that all successfully parsed `run` commands have the script argument
set, leading to the panic on
`matches.remove_many::<String>("script_arg").unwrap()`.
Clap, as far as I was able to find out, does not currently offer a neat
solution to this problem. This PR adds logic to create and return a
custom clap error when a parsed run command does not have the script
argument.
I added an appropriate test.
Diffstat (limited to 'ext/fetch/20_headers.js')
0 files changed, 0 insertions, 0 deletions