apk-tools (ZSH completions)
Added Zsh tab-completion support to Alpine Linux's apk-tools package manager, generated from the project's existing manpage sources.
The Gap
Chimera Linux uses apk as its package manager, but unlike Alpine
Linux, ships no Zsh completions for it. Alpine’s own completions turned
out to be a hand-maintained file, disconnected from apk-tools itself,
with an existing but unclaimed proposal to generate completions
properly, rather than hand-copying a static file between projects.
What Changed
Extended apk-tools’s existing genhelp pipeline — which already
generated the tool’s built-in help text and Bash completions from its
SCDOC manpage sources — with a third output plugin, genhelp_zsh.lua,
implementing the same generate(app, docs) contract as the existing
plugins.
Along the way, fixed two pre-existing build-system issues, unrelated to
Zsh specifically: a hardcoded --format=bash check in the argument
parser and a Meson build-target collision between the Bash and Zsh
outputs, which both conventionally share the name _apk.
Merged upstream as merge request !415. The full account — including the ten-month gap and the false start that led here — is on the blog.