0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00
denoland-deno/cli/args
Kira ca9ba87d99
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.
2023-08-13 04:04:17 +02:00
..
config_file.rs feat(unstable): rename deno_modules to vendor (#20065) 2023-08-06 21:56:56 -04:00
flags.rs fix(cli) error gracefully when script arg is not present and --v8-flags is present in deno run (#20145) 2023-08-13 04:04:17 +02:00
flags_net.rs feat(permissions): add "--deny-*" flags (#19070) 2023-08-03 13:19:19 +02:00
import_map.rs chore: upgrade to Rust 1.67 (#17548) 2023-01-27 10:43:16 -05:00
lockfile.rs refactor(cli): move snapshot_from_lockfile function to deno_npm (#20024) 2023-08-08 10:07:29 -07:00
mod.rs refactor(cli): move snapshot_from_lockfile function to deno_npm (#20024) 2023-08-08 10:07:29 -07:00
package_json.rs fix(check): should bust check cache when json module or npm resolution changes (#19941) 2023-07-26 17:23:07 -04:00