Repository navigation
fix: accept --version and -version as a global flag - #15
Merged
Merged
Conversation
`pullgate --version` failed with "flag provided but not defined". It now prints the same line as `pullgate version` and exits 0, also after other global flags. `--help` and the README name both forms. Fixes #14 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
groupsky
force-pushed
the
fix/version-flag
branch
from
November 16, 2026 11:06
18f6bd1 to
7ccac79
Compare
3 tasks
5 tasks done
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.
Fixes #14.
pullgate --versionfailed in v0.1.0 with "flag provided but not defined". Now:pullgate --versionandpullgate -versionprintpullgate X.Y.Zon stdout and exit 0, also after other global flags (pullgate --config-dir /x --version). They return before any config, state or spool is read.pullgate versionworks as before.install.shstill uses it, so nothing changes there.pullgate --helplists--version. The README names both forms.--versionis a global flag only. After a command (pullgate run NAME --version) it is still an unknown argument, exit 64.Tests in
cmd/pullgate/main_test.go:TestVersionForms:version,--version,-version,--config-dir /x --version, all global flags then-version, and--version run example(prints the version, reads no config).TestVersionDeny:--version=maybe,--versions,--config-dir --version(no command),--versionafterrun,statusandlisten, and--version=falseall exit 64 with no stdout.TestHelpListsVersion:--helpand-hlist--versionandversion.Reviews: the security reviewer found no critical, high or medium findings. One low wording point (a dev build prints
pullgate dev) is fixed in the README. The correctness review found no bugs. Its two small points (a test for the flag after a command, and the README placement) are fixed. DESIGN.md and THREAT-MODEL.md need no change: no message, check, user or file changes.🤖 Generated with Claude Code