feat(broker): add --version/-V so the self-update probe shows its version#458
Merged
Conversation
…sion `uffs-broker` had no --version arm: any unrecognised flag fell through to the SCM service dispatch, which (run interactively) prints usage text. The self-update snapshot probes each binary with `<bin> --version` and parses a semver token from the output, so the broker came back as `?` in `uffs --update` — the only binary without a resolvable version, leaving skew detection blind to it. Add a cross-platform --version/-V arm in main(), handled before the Windows-only service dispatch, printing `uffs-broker <version>` to stdout in the same shape as every other UFFS binary (`uffs <version>`). Works on every platform and exits 0. Also: list --version in the usage help, and add a parse_version regression test for the hyphenated `uffs-broker 0.6.9` line (the name's hyphen must not be mistaken for part of the version token). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
In
uffs --update, every binary resolves a version except the broker:uffs-brokerhad no--versionarm — any unrecognised flag falls through to the SCM service dispatch, which (run interactively) prints usage text. The self-update snapshot probes each binary with<bin> --versionand parses a semver token from the output, so the broker came back as?: the only binary without a resolvable version, leaving version-skew detection blind to it.Fix
--version/-Varm inmain(), handled before the Windows-only service dispatch, printinguffs-broker <version>to stdout in the same shape as every other UFFS binary (uffs <version>). Works on every platform, exits 0.--versionin the usage help.parse_versionregression test for the hyphenateduffs-broker 0.6.9line (the name's hyphen must not be mistaken for part of the version token).Verification
Parser extracts
0.6.9; all 7binaries::testspass. Result: theuffs-broker ?line inuffs --updatebecomesuffs-broker 0.6.9.🤖 Generated with Claude Code