Add version information and CLI argument parsing - #17
Merged
Conversation
…naries `luacad-studio` used to ignore everything but the first argument, so `-h` and `-v` silently started the GUI instead of answering. It now parses its command line with clap, like the `luacad` CLI: `[file.lua]` is a declared argument, unknown flags are reported, and `-h`/`--help` and `-v`/`--version` print and exit before a window is created. macOS' `-psn_…` process serial number is dropped first, so opening the app from Finder still works. A build script bakes `git describe --always --dirty --tags` into the version of a build made from a git checkout (`1.1.0 (v1.1.0-3-g23a0ea2-dirty)`), so a locally built binary can be identified without hashing it. Builds without a checkout, and clean release tags, keep the plain crate version; `LUACAD_GIT_DESCRIBE` overrides the suffix for reproducible packaging. The release job now checks out the full history, which `git describe` needs. In the GUI the same information lives in Settings → About, opened by the new `ℹ About` button next to Settings (and by one in the bottom bar while the code editor is hidden), together with the build target and a button that copies it all for a bug report. Closes #15 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U7tjYSVoJDhm6ShFTGjz2S
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive version information to both the
luacadandluacad-studiobinaries, along with proper command-line argument parsing for Studio.Summary
The changes introduce a build-time version module that embeds the crate version, git commit information (when built from a git checkout), and build target. Both binaries now support
-v/--versionand-h/--helpflags that exit immediately. Studio gains an "About" settings tab and button to display this information in the GUI.Key Changes
luacad/src/version.rs: Module that exposes version constants (CRATE_VERSION,GIT_DESCRIBE,BUILD_TARGET,VERSION) populated by the build scriptluacad/build.rs: Build script that runsgit describe --always --dirty --tagsto capture commit information, with support forLUACAD_GIT_DESCRIBEenvironment variable for reproducible buildsstd::env::args()parsing withclapto properly handle-v/--version,-h/--help, and file arguments. Addedwithout_launch_serial()to filter macOS LaunchServices'-psn_*flagsℹ Aboutbutton in both editor panel and bottom bar for quick accessabout_row()helper function for consistent label/value display with selectable text for bug reportspainted_texttracking to UI test harness to verify version information appears in the About tab and About button is accessible when editor is hiddenImplementation Details
{version} ({git_describe})for development buildsluacadandluacad-studioCLIs use the same version constant for consistencyhttps://claude.ai/code/session_01U7tjYSVoJDhm6ShFTGjz2S