Skip to content

feat: one source of truth for the version, and --version on both binaries - #101

Merged
zcsizmadia merged 1 commit into
mainfrom
feat/version-strings
Sep 5, 2026
Merged

zcsizmadia merged 1 commit into
mainfrom
feat/version-strings

Conversation

@zcsizmadia

Copy link
Copy Markdown
Collaborator

Closes #76.

The version was written by hand in several places and had drifted: CMake said 0.9.0, the handshake introduced itself as wsldrive/0.1, and build-installer.ps1 defaulted to 0.1.0 — so README route 3 stamped a 0.1.0 installer onto a 0.9.0 build. Nothing printed a version at all, so neither a user nor a bug report could say which build was in play.

PROJECT_VERSION is now the only place the number appears. CMake generates core/version.hpp from it and everything reads that:

consumer before now
wsldrive / wsldrived --version did not exist prints the version
usage banners no version lead with it
Hello handshake agent string wsldrive/0.1 wsldrive/0.9.0
Windows VERSIONINFO absent on all three executables
build-installer.ps1 hard-coded 0.1.0 read from CMakeLists.txt

--version is answered before any other argument handling, so it works on a machine where WinFsp, a distro, or a reachable agent are not set up yet — which is exactly when someone asks.

Verification

wsldrive 0.9.0          wsldrived 0.9.0
wsldrive    FileVersion=0.9.0  Desc=wsldrive command line tool
wsldrived   FileVersion=0.9.0  Desc=wsldrive agent (serves a directory tree)
wsldrivew   FileVersion=0.9.0  Desc=wsldrive windowless launcher
building installer for wsldrive 0.9.0      # with no -Version argument

Linux 124/124, Windows 122/122; conformance 31/0 Linux, 28/0 Windows. A unit test pins the header to the project version and asserts the agent strings are built from it rather than repeating a literal.

🤖 Generated with Claude Code

The version was written out by hand in several places and had drifted apart.
CMake said 0.9.0, the handshake introduced itself as "wsldrive/0.1", and
build-installer.ps1 defaulted to 0.1.0 - so README route 3 stamped a 0.1.0
installer onto a 0.9.0 build. Nothing printed a version at all, so a user could
not say which build they had, and neither could a bug report.

PROJECT_VERSION is now the only place the number appears. CMake generates
core/version.hpp from it, and everything else reads that:

- `wsldrive --version` / `wsldrived --version`, answered before any other
  argument handling so they still work on a machine where WinFsp, a distro or a
  reachable agent are not set up yet - which is when the question gets asked.
- Both usage banners lead with the version.
- The Hello handshake agent strings.
- A Windows VERSIONINFO resource on all three executables, so Explorer's
  Details tab and (Get-Item wsldrive.exe).VersionInfo report the build.
- build-installer.ps1 reads the version out of CMakeLists.txt instead of
  carrying its own default.

Verified: `wsldrive --version` and `wsldrived --version` print 0.9.0 on both
platforms; all three Windows binaries report FileVersion 0.9.0 with distinct
descriptions; build-installer.ps1 resolves 0.9.0 with no -Version argument.
Linux 124/124, Windows 122/122, conformance 31/0 Linux and 28/0 Windows.

Closes #76

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@zcsizmadia zcsizmadia added the enhancement New feature or request label Sep 5, 2026
@zcsizmadia
zcsizmadia merged commit fa96797 into main Sep 5, 2026
6 checks passed
@zcsizmadia
zcsizmadia deleted the feat/version-strings branch September 5, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: add --version (and a VERSIONINFO resource); unify version strings

1 participant