feat(git-remote-gitlawb): add --version and --help flags#30
feat(git-remote-gitlawb): add --version and --help flags#30FrozenRaspberry wants to merge 1 commit into
Conversation
git-remote-gitlawb was the only workspace binary without `--version`, so
release smoke tests could not validate the packaged helper directly. This
is called out in docs/MAINTAINER-ROADMAP.md ("Add --version support to
git-remote-gitlawb so release smoke tests can validate it directly") and
docs/OSS-READINESS-AUDIT.md.
- `--version`/`-V` prints `git-remote-gitlawb <version>`, matching the
`<bin> <version>` format the clap-based `gl` and `gitlawb-node` emit so
release tooling can treat all three binaries uniformly. The version
comes from CARGO_PKG_VERSION.
- `--help`/`-h` prints concise usage (URL form, env vars, flags).
- Flags are only recognized as the first argument, so git's
`<remote-name> <url>` remote-helper invocation path is untouched; a
remote literally named "--version" is not mistaken for the flag.
- Informational flags are handled before tracing init so output stays
clean for scripts.
Adds unit tests for argument classification (including the no-args and
misplaced-flag edge cases) and the version/help strings.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request adds CLI flag support to the git-remote-gitlawb binary. The main function is refactored to collect arguments early, classify and handle ChangesCLI Flag Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What
Adds
--version/-Vand--help/-htogit-remote-gitlawb.Why
git-remote-gitlawbis the only workspace binary without--version, which is called out in:docs/MAINTAINER-ROADMAP.md— "Add--versionsupport togit-remote-gitlawbso release smoke tests can validate it directly."docs/OSS-READINESS-AUDIT.md— "git-remote-gitlawbhas no--versionflag; release smoke tests should use a helper-specific invocation."How
--version/-Vprintsgit-remote-gitlawb <version>, matching the<bin> <version>format the clap-basedglandgitlawb-nodeemit, so release tooling can treat all three binaries uniformly. The version comes fromCARGO_PKG_VERSION, so it tracks the workspace version automatically.--help/-hprints concise usage (URL form, env vars, flags).<remote-name> <url>remote-helper invocation path is completely untouched. A remote literally named--versionis not mistaken for the flag (covered by a test).tracinginit so the output stays clean for scripts/smoke tests.No protocol or API changes. Purely additive, no breaking changes.
Testing
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings, andcargo test -p git-remote-gitlawball pass.git-remote-gitlawb --version→git-remote-gitlawb 0.3.9--helprenders the usage text1with a usage hintFollow-up (separate PR)
This unblocks per-binary release smoke tests. I'm happy to send a small follow-up wiring
--versionchecks for all three binaries intorelease.yml(the audit also notes "release binaries are not smoke-tested after packaging") — kept out of this PR to keep it focused on one change.Summary by CodeRabbit
--versionflag to display application version information--helpflag to display usage documentation