Skip to content
This repository was archived by the owner on Oct 9, 2026. It is now read-only.

Parse the CLI with typed clap derive structs - #55

Merged
sidkmenon merged 4 commits into
mainfrom
cli/derive
Sep 30, 2026
Merged

sidkmenon merged 4 commits into
mainfrom
cli/derive

Conversation

@sidkmenon

Copy link
Copy Markdown
Contributor

Stack created with GitHub Stacks CLI • Give Feedback 💬

No behavior change. The CLI is about to move from hand-built Commands to
typed derive structs.

AI assistance: Claude Code.

Agent-Session: b28d94c6-2325-41ab-9fab-e9027acc5b09
Agent-Session: 01a0e9c2-2c41-7062-b484-92e030c4ab9c
No behavior change. Cli, Command, ConfigArgs and ConfigCommand describe the
same arguments the builder below defines: the same help strings, groups and
conflicts, and the builder's lowercase value names (`<repo>`, `[items]...`)
spelled out so help, usage and errors stay byte-identical. Nothing uses
them yet.

AI assistance: Claude Code.

Agent-Session: b28d94c6-2325-41ab-9fab-e9027acc5b09
Agent-Session: 01a0e9c2-2c41-7062-b484-92e030c4ab9c
No behavior change. The builder and every get_flag("...") /
get_one().unwrap() lookup give way to field access on the parsed Cli; the
config subcommand becomes an enum match, so the unreachable "unknown config
command" arm goes. The split at `--` before parsing is kept as is.

AI assistance: Claude Code.

Agent-Session: b28d94c6-2325-41ab-9fab-e9027acc5b09
Agent-Session: 01a0e9c2-2c41-7062-b484-92e030c4ab9c
No behavior change. options.rs's second hand-built Command becomes a
`#[derive(Parser)]` struct with the same name, usage, version strings,
alphabetical option order and env vars; main still dispatches on
argv[1] == "debug" and parse_args still returns a Mode.

AI assistance: Claude Code.

Agent-Session: b28d94c6-2325-41ab-9fab-e9027acc5b09
Agent-Session: 01a0e9c2-2c41-7062-b484-92e030c4ab9c
@sidkmenon
sidkmenon added this pull request to stack #59 September 30, 2026 16:28
@sidkmenon
sidkmenon marked this pull request as ready for review September 30, 2026 17:11
@sidkmenon sidkmenon changed the title cli/derive Parse the CLI with typed clap derive structs Sep 30, 2026
@sidkmenon
sidkmenon merged commit 5578350 into main Sep 30, 2026
46 checks passed
@thesiti92 thesiti92 mentioned this pull request Sep 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant