Skip to content

feat: print version in --help and usage output#6

Merged
jamiesun merged 1 commit into
mainfrom
feat/help-show-version
Jun 9, 2026
Merged

feat: print version in --help and usage output#6
jamiesun merged 1 commit into
mainfrom
feat/help-show-version

Conversation

@jamiesun

@jamiesun jamiesun commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

sshx --help (and the no-argument usage screen) now print a Version: <version> line at the top, alongside the existing --version flag.

Changes

  • Add app.Version (default dev); main sets it from the -ldflags-injected main.Version at startup.
  • PrintUsage() prints Version: <version> under the title.
  • CHANGELOG [Unreleased] note.

Test

  • go test ./internal/app/... passes (existing usage tests still green; output still starts with a newline and contains the title).
  • Verified --help, no-args usage, and --version all show the version.

Wire the build version (main.Version) into the app package and show a 'Version: <version>' line at the top of PrintUsage, so 'sshx --help' and the no-argument usage screen display the version alongside --version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamiesun jamiesun merged commit 6b59166 into main Jun 9, 2026
6 checks passed
@jamiesun jamiesun deleted the feat/help-show-version branch June 9, 2026 16:30
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