Skip to content

Add --version flag to vmnet-broker #84

Description

@nirs

Summary

Add a --version flag to the vmnet-broker binary to print version information and exit.

Motivation

  1. Install verification: The install workflow can verify the correct version is installed
  2. User troubleshooting: Users can easily check what version they have
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions