Skip to content

test(parse): add clap micro-conformance - #1133

Merged
jdx merged 1 commit into
agent/recursive-helpfrom
agent/clap-micro-conformance
Aug 21, 2026
Merged

test(parse): add clap micro-conformance#1133
jdx merged 1 commit into
agent/recursive-helpfrom
agent/clap-micro-conformance

Conversation

@jdx

@jdx jdx commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a paired clap/usage typed-CLI harness that compares accepted argv, terminal status/stream, diagnostics, help semantics, and version output
  • add the first setting-specific row for require_equals
  • match clap's equals-specific diagnostic and render = in typed help placeholders

This establishes the executable harness for the larger generated micro-conformance PLAN item; later stack PRs can add matrix rows without mixing harness design into every feature test.

Validation

  • cargo test -p usage-conformance --test clap_micro --all-features
  • cargo test -p usage-argv --all-features
  • cargo clippy --workspace --all-features --all-targets -- -D warnings

This PR was generated by Codex.


Note

Medium Risk
Changes the public parse-error enum and help/spec usage rendering, which can break embedders that treated empty-argv help as Error::Help. Behavior is test-covered but is a user-visible CLI contract change.

Overview
Adds a paired clap/usage typed-CLI harness (clap_micro) that compares accepted argv, typed values, error kinds, exit status/stream, help, and version for the first matrix rows (require_equals, defaults, delimiters, hyphen/negative values, enums, arity, globals, groups, external subcommands, and command policies).

Splits arg_required_else_help into Error::MissingArgsHelp so generated parse() prints short help to stderr and exits 2, matching clap, instead of treating it as an explicit help request.

Aligns require_equals presentation: missing-value diagnostics now say an equals is required, and help/spec usage render --flag=<VAL> / --flag[=VAL], including round-trip parsing of those forms.

Reviewed by Cursor Bugbot for commit 271fdb1. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 1be1f615-426c-4218-8082-a703faa72a3d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jdx
jdx force-pushed the agent/clap-micro-conformance branch 3 times, most recently from 8f532f4 to 8a80244 Compare August 20, 2026 15:00
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 8a80244 to b0fe19b Compare August 20, 2026 15:02
Comment thread argv/src/help.rs Outdated
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from b0fe19b to 71a0447 Compare August 20, 2026 15:08
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 71a0447 to 75b4b8e Compare August 20, 2026 15:17
Comment thread derive/src/codegen.rs
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Instruction counts

The comparison never ran — an earlier step failed.

271fdb1f8f6c vs `` · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 75b4b8e to ee98508 Compare August 20, 2026 15:28

jdx commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

Addressed in the owning PR: missing-argument help now selects ANSI color from stderr, while ordinary help continues to inspect stdout. I also fixed the fleet failure this conformance work exposed by rendering require_equals as --flag=<VALUE> in usage-lib, matching usage-argv.

This comment was generated by Codex.

Comment thread lib/src/spec/flag.rs Outdated
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from ee98508 to 9bd5c79 Compare August 20, 2026 15:39

jdx commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

Addressed in #1133: reference documentation now uses = for require_equals, and the regression covers both interactive and reference usage strings.

This comment was generated by Codex.

@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 9bd5c79 to e6d34d4 Compare August 20, 2026 16:01
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from e6d34d4 to 561ab79 Compare August 21, 2026 01:50
@jdx
jdx force-pushed the agent/clap-micro-conformance branch 2 times, most recently from 37014ac to fad90db Compare August 21, 2026 03:20
Comment thread argv/src/help.rs
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from fad90db to c7bc4fd Compare August 21, 2026 03:40
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from c7bc4fd to 5154820 Compare August 21, 2026 03:43
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 2d62c65 to 68f9e97 Compare August 21, 2026 05:36
Comment thread conformance/tests/clap_micro.rs Outdated
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 68f9e97 to 231c309 Compare August 21, 2026 05:47
Comment thread lib/src/spec/flag.rs Outdated
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 231c309 to 668ceaa Compare August 21, 2026 06:08
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 668ceaa to b8074c2 Compare August 21, 2026 06:11
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from b8074c2 to 9e43fe7 Compare August 21, 2026 06:23
Comment thread lib/src/spec/flag.rs Outdated
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 9e43fe7 to 99d6539 Compare August 21, 2026 06:35
Comment thread argv/src/help.rs
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 99d6539 to a4a3172 Compare August 21, 2026 06:46
Comment thread lib/src/spec/flag.rs Outdated
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from a4a3172 to 3644e72 Compare August 21, 2026 06:56
Comment thread lib/src/spec/flag.rs
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from 3644e72 to 126c975 Compare August 21, 2026 07:10

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 126c975. Configure here.

Comment thread lib/src/spec/flag.rs
@jdx
jdx force-pushed the agent/clap-micro-conformance branch 2 times, most recently from 2fee415 to e463883 Compare August 21, 2026 07:30
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from e463883 to c9a0804 Compare August 21, 2026 07:49
@jdx
jdx force-pushed the agent/clap-micro-conformance branch from c9a0804 to 271fdb1 Compare August 21, 2026 08:32
@jdx
jdx merged commit c342d9e into main Aug 21, 2026
8 of 15 checks passed
@jdx
jdx deleted the agent/clap-micro-conformance branch August 21, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant