Upgrade kingpin for fish shell completions - #381
Merged
Merged
Conversation
mbyczkowski
marked this pull request as ready for review
September 29, 2026 05:34
mbyczkowski
enabled auto-merge
September 29, 2026 05:34
randradesq
approved these changes
Sep 30, 2026
Closed
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.
Why
certigo uses kingpin to parse its command line. Kingpin can also print shell completion scripts through hidden flags such as
--completion-script-bash. The Homebrew formula uses these flags to install bash and zsh completions.Kingpin v2.4.0, the version certigo uses today, has no fish support. #365 fills the gap with a hand-written fish script. Kingpin added fish support upstream in March 2026, in alecthomas/kingpin#363 and the fixup alecthomas/kingpin#364. The upgrade gets us fish completions with no script to maintain.
What
github.com/alecthomas/kingpin/v2fromv2.4.0tov2.4.1-0.20260925234028-f5476eeb56de, the newest commit on kingpin master.certigo --completion-script-fishnow prints a fish completion script.How
Kingpin has not tagged a release since v2.4.0 in September 2023, so this pins a pseudo-version (Go's name for an untagged commit).
go.sumrecords its hash, so builds stay reproducible.The fish script is one rule. It passes the words typed so far to
certigo --completion-bash, the same hook the bash script uses, so it stays in step with the CLI. When certigo has no suggestion, as for a file argument, fish falls back to file paths.I pinned the newest commit instead of the fixup (
f0601543). The five commits after the fixup are a dependency bump, a CI update, typo fixes, a linker change, and a fix that keeps the value of a bare-argument.Risk
Low. Only
go.modandgo.sumchange, and no other module moves. Help text and bash/zsh completion output are the same as before.One error message changes.
certigo dump -now sayspath '-' does not existinstead ofpath '' does not exist. The command failed before too, and certigo reads stdin only whendumpgets no file.Untagged code has had less use than a release. Also, the fish script uses
commandline -x, which fish added in 4.0 (February 2025), so it will not work on fish 3.x.Testing
I built master and this branch with Go 1.27.1 and
CGO_ENABLED=0, then compared their output:--help,--version, and--helpforconnect,dumpandverifyprint the same text.--completion-script-bashand--completion-script-zshprint the same scripts.--completion-bashreturns the same candidates for commands, flags and the--start-tlsvalues.--completion-script-fishfails on master withunknown long flag '--completion-script-fish'. This branch prints:I have not run the script in a live fish shell.
Bigger picture
:fishto the shells it passes togenerate_completions_from_executable. Today it installs only bash and zsh completions.Generated with Claude Code