deno
4e8b2f46 - refactor: add CLI parser conversion, defs, help, and completions (#35343)

Commit
70 days ago
refactor: add CLI parser conversion, defs, help, and completions (#35343) This is the third step of splitting #33325 (replace clap with a zero-cost CLI parser) and follows #35333 and #35334, which have landed. It adds the remaining parser modules to the `deno_cli_parser` crate: `defs.rs` (the static `CommandDef` tree for the real Deno commands), `convert.rs` (turns a `ParseResult` into `Flags`), and `help.rs` / `completions.rs` (render help text and shell completions from the same static tables). help and completions live here rather than in their own change because `convert` depends on them directly. This is purely additive and is not wired into the CLI's parsing path, so it cannot change any runtime behavior: clap still parses every argument in production and nothing calls this code yet. The conversion layer has been reconciled against the current `Flags` types so the crate compiles, but it is intentionally not yet covered by the parity test suite and does not yet handle the subcommands added since the original parser was written. The next PR ports the full parity test suite (current main's flag tests, rewired onto this parser), adds the missing subcommands, and grinds the conversion to match clap exactly. Landing the unvalidated conversion code first keeps that test-and-fix PR focused on behavior rather than on a huge mechanical diff.
Author
Parents
Loading