Summary
Add a --version flag to the vmnet-broker binary to print version information and exit.
Motivation
- Install verification: The install workflow can verify the correct version is installed
- User troubleshooting: Users can easily check what version they have
- Consistency: Matches vmnet-helper's behavior
Implementation
- Check for
--version in main() before setup
- Print version info and exit
- Use YAML output like vmnet-helper
- Example output:
$ /Library/Application\ Support/vmnet-broker/vmnet-broker --version
version: v0.3.0
commit: a459afb853e8cb06e0fdb28df3350d4859d6a460
Usage in install workflow
out=$("/Library/Application Support/vmnet-broker/vmnet-broker" --version)
version=$(echo $out | jq .version)
commit=$(echo $out | jq .commit)
if [[ "$version" != "$EXPECTED_VERSION" ]]; then
echo "Version mismatch"
exit 1
fi
if [[ "$commit" != "$EXPECTED_COMMIT" ]]; then
echo "Commit mismatch"
exit 1
fi
Summary
Add a
--versionflag to the vmnet-broker binary to print version information and exit.Motivation
Implementation
--versioninmain()before setupUsage in install workflow