Document Bash completion setup

This commit is contained in:
2026-11-03 13:12:36 +00:00
parent f79f446726
commit 8964ad02ad
6 changed files with 38 additions and 5 deletions

View File

@@ -168,3 +168,17 @@ go run ./examples/core workspace greet --count=0 --tag=first --tag second
The [consumer guide](consumers/guide.md) explains how their public API usage
fits together.
## Shell completion validation
The opt-in interactive completion checks require Bash, Zsh, Fish, Python with
`pexpect`, and the Bash completion package. The harness starts a clean Bash
and sources `/usr/share/bash-completion/bash_completion` by default. Set
`COMPLETION_BASH_INIT` to your installation's initialization file if it is
elsewhere. See the [operator setup](cli.md#shell-completion) for ordinary use.
```sh
COMMANDKIT_COMPLETION_SHELLS=1 go test -count=1 -run '^TestCompletionShells$' ./internal/cobra
COMMANDKIT_COMPLETION_SHELLS=1 go test -count=1 -run '^TestCompletionConsumerInShells$' .
```