Skip to content

Add version flag support - #2

Merged
mktbsh merged 7 commits into
mainfrom
version-flag
Apr 22, 2026
Merged

mktbsh merged 7 commits into
mainfrom
version-flag

Conversation

@mktbsh

@mktbsh mktbsh commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add -v and --version so the CLI prints a version and exits before benchmark work
  • resolve version from injected build metadata, then Go build info, then dev, with nil-safe fallback handling
  • add CLI tests and update English/Japanese README usage docs

Test Plan

  • go test ./...
  • go build -trimpath -ldflags="-s -w" -o dist/unispeedtest ./cmd/unispeedtest
  • ./dist/unispeedtest --version

mktbsh and others added 7 commits April 23, 2026 01:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add version helper functions and tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Short-circuit version flags before benchmark execution by routing CLI handling through a testable run function.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Guard against nil BuildInfo when debug.ReadBuildInfo returns (nil,true).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mktbsh
mktbsh merged commit db5dc2d into main Apr 22, 2026
2 checks passed
@mktbsh
mktbsh deleted the version-flag branch April 22, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant