Add bash/zsh shell completion

vintner completion bash|zsh prints a completion script meant to be
sourced (source <(vintner completion bash)); completes subcommands
(including short aliases), download's flags, and directory arguments
for install/env --bin. Mentioned in the top-level usage text and
documented in the README.

The Nivora package doesn't auto-install these system-wide yet - it'd
need Stapler's install-completion helper, whose calling convention
isn't documented anywhere in this repo or Nivora's other packages, so
guessing at it risked a broken package build for a nice-to-have.
source <(vintner completion bash) works today regardless of install
method (Nivora, prebuilt binary, or from source).
This commit is contained in:
Cheviiot
2026-07-25 10:39:22 +10:00
parent 98ee39018a
commit 26f6df6a9a
5 changed files with 202 additions and 0 deletions
+2
View File
@@ -47,6 +47,8 @@ func runCLI(args []string) int {
return runInstall(args[1:])
case "env", "e":
return runEnv(args[1:])
case "completion":
return runCompletion(args[1:])
case "version", "v", "--version":
fmt.Println("vintner " + version)
return 0