You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: pullgate --version fails with "flag provided but not defined" #14
$ pullgate --version
pullgate: flag provided but not defined: -version; see "pullgate --help" (exit 64)
Only the version command works (pullgate version prints pullgate 0.1.0). Most tools take --version, so people and scripts try it first. Found on 2026-11-16, in the first real run of install.sh against v0.1.0 (#7).
cmd/pullgate/main.go defines its global flags with flag.NewFlagSet; --version is not one of them.
Proposal
pullgate --version and pullgate -version print the same line as pullgate version and exit 0, also with other global flags before them.
--help and the README name both forms.
install.sh keeps calling the version command (it works with every release), so nothing changes there.
Done when
pullgate --version prints pullgate X.Y.Z on stdout and exits 0; a test covers it.
pullgate --config-dir /x --version does the same.
pullgate version still works as before; a test covers it.
pullgate --help lists --version.
The fix is in a released version (fix: commit, so release-please makes a patch release).
Fixed in #15 (squash commit 5450bbc). Evidence for each box:
pullgate --version prints pullgate X.Y.Z on stdout and exits 0.TestVersionForms in cmd/pullgate/main_test.go runs --version and -version with the version set to 1.2.3 and checks: exit 0, stdout exactly pullgate 1.2.3\n, empty stderr.
pullgate --config-dir /x --version does the same. The same test runs --config-dir /x --version and --config-dir=/x --state-dir /y --spool-dir /z -version. The flag returns before any config is read.
pullgate version still works.TestVersionForms runs version too. install.sh still uses it.
pullgate --help lists --version.TestHelpListsVersion checks --help and -h. The README names both forms.
Deny paths (TestVersionDeny): --version=maybe, --versions, --config-dir --version (no command), --version=false, and --version after run, status or listen all exit 64 with no stdout.
CI was red on main for a reason outside this change (the runner's newer systemd warns about its own units). #16 fixed that first. A flaky e2e wait seen on main is #17.
In a released version. Check on 2026-11-16, in a throwaway container (docker run --rm debian:stable-slim, with curl and ca-certificates): install.sh from the tag v0.1.1 (SHA-256 a6ebc029b65f72f0251f496850f5af8ba77aae00ef5daf6a4882656598ca57e6), run as root with --version 0.1.1:
Asking GitHub for the release v0.1.1 of pullgate.
Installing pullgate 0.1.1 as /usr/local/bin/pullgate.
Downloading pullgate_0.1.1_linux_amd64.tar.gz, SHA256SUMS and pullgate_0.1.1.sigstore.json.
Downloading gh 2.102.0 to check the attestation.
Checking the build attestation of pullgate_0.1.1_linux_amd64.tar.gz with gh 2.102.0.
The attestation is valid: the release workflow of code6x/pullgate on main built this file.
Done. /usr/local/bin/pullgate version says: pullgate 0.1.1
install exit: 0
--- /usr/local/bin/pullgate --version:
pullgate 0.1.1
exit: 0
Activity
fix: accept --version and -version as a global flag
groupsky commentedon Nov 16, 2026
Fixed in #15 (squash commit 5450bbc). Evidence for each box:
pullgate --versionprintspullgate X.Y.Zon stdout and exits 0.TestVersionFormsincmd/pullgate/main_test.goruns--versionand-versionwith the version set to1.2.3and checks: exit 0, stdout exactlypullgate 1.2.3\n, empty stderr.pullgate --config-dir /x --versiondoes the same. The same test runs--config-dir /x --versionand--config-dir=/x --state-dir /y --spool-dir /z -version. The flag returns before any config is read.pullgate versionstill works.TestVersionFormsrunsversiontoo.install.shstill uses it.pullgate --helplists--version.TestHelpListsVersionchecks--helpand-h. The README names both forms.chore(main): release 0.1.1) waits for the owner's OK.Deny paths (
TestVersionDeny):--version=maybe,--versions,--config-dir --version(no command),--version=false, and--versionafterrun,statusorlistenall exit 64 with no stdout.CI was red on
mainfor a reason outside this change (the runner's newer systemd warns about its own units). #16 fixed that first. A flaky e2e wait seen onmainis #17.groupsky commentedon Nov 16, 2026
Released in v0.1.1 (release PR #18, squash commit 8cd9c09, the Release workflow passed): https://github.com/code6x/pullgate/releases/tag/v0.1.1
docker run --rm debian:stable-slim, withcurlandca-certificates):install.shfrom the tagv0.1.1(SHA-256a6ebc029b65f72f0251f496850f5af8ba77aae00ef5daf6a4882656598ca57e6), run as root with--version 0.1.1:All boxes are met, so I close this issue.