feat(cli): consolidate --help and --version output across all binaries - #40
Open
rodonile wants to merge 1 commit into
Open
feat(cli): consolidate --help and --version output across all binaries#40rodonile wants to merge 1 commit into
rodonile wants to merge 1 commit into
Conversation
rodonile
force-pushed
the
cli-consolidate
branch
2 times, most recently
from
August 21, 2026 07:49
47f2ac0 to
ed28170
Compare
rodonile
force-pushed
the
cli-consolidate
branch
from
September 1, 2026 11:13
ed28170 to
eae15a6
Compare
rodonile
marked this pull request as ready for review
September 1, 2026 11:14
rodonile
enabled auto-merge (rebase)
September 1, 2026 11:14
rodonile
disabled auto-merge
September 1, 2026 11:16
There was a problem hiding this comment.
Pull request overview
This PR standardizes --version / -V output across the workspace’s CLI binaries by switching to a shared multi-line build-info version string (commit, branch/tag, build time, toolchain, OS) and aligning clap configuration so --version can exit early without requiring other arguments.
Changes:
- Added a shared-style
version_info()multi-line string tocollector,pcap-decoder, andyang-consumer, and wired it into clap’s version handling. - Updated
collectorto use clap’sArgAction::Version(-V) instead of a manual-v/--versionearly-exit branch, and madeconfig_filerequired again. - Added
shadow-rsbuild integration forpcap-decoder(newbuild.rs, Cargo.toml updates, lockfile update).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/yang-consumer/src/main.rs | Adds custom multi-line version info and a -V/--version flag using clap’s version action. |
| crates/pcap-decoder/src/main.rs | Adds shadow-rs build metadata and uses the shared multi-line version output via clap. |
| crates/pcap-decoder/Cargo.toml | Enables a build script and adds shadow-rs dependency/build-dependency. |
| crates/pcap-decoder/build.rs | Generates shadow-rs build metadata during compilation. |
| crates/collector/src/main.rs | Replaces manual version printing with clap’s version action and shared version string. |
| Cargo.lock | Records the new shadow-rs dependency for pcap-decoder. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ustorbeck
self-requested a review
September 1, 2026 11:42
ustorbeck
previously approved these changes
Sep 1, 2026
Add build.rs/shadow-rs wiring to pcap-decoder so `--version` prints commit, branch, build time, rustc and OS info like collector and yang-consumer. Also switch collector and yang-consumer to clap's native ArgAction::Version (-V) so --version works without requiring other positional/required args.
rodonile
force-pushed
the
cli-consolidate
branch
from
September 1, 2026 11:46
eae15a6 to
53e1f41
Compare
ustorbeck
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR depends on #39.
Summary
Adds consistent, detailed
--version/-Voutput across the CLI binaries(
pcap-decoder,collector,yang-consumer), showing commit hash/date,branch/tag, build time, Rust toolchain, and OS.
Changes
build.rs+shadow-rsbuild-dependency (mirrorscollector/yang-consumersetup) and a customversion_info()used for--version.-v/--versionboolean flag andearly-exit branch with clap's built-in
ArgAction::Version(-V), whichlets
--versionrun without requiringconfig_fileto be provided.#[command(version)]tothe same custom multi-line
version_info()used elsewhere.