flaglint completion
flaglint completion prints a shell completion script to stdout. Source it once and your shell will tab-complete subcommands, flags, and flag values (format choices, shell names, and more).
Command
Section titled “Command”flaglint completion <shell>Supported shells: bash, zsh, fish.
Installation
Section titled “Installation”Load for the current session only:
source <(flaglint completion bash)Load permanently (add to ~/.bashrc or ~/.bash_profile):
flaglint completion bash >> ~/.bash_completionLoad for the current session only:
source <(flaglint completion zsh)Load permanently (requires ~/.zsh/completions in your $fpath):
mkdir -p ~/.zsh/completionsflaglint completion zsh > ~/.zsh/completions/_flaglintThen ensure $fpath includes the directory before compinit runs — add to ~/.zshrc:
fpath=(~/.zsh/completions $fpath)autoload -Uz compinit && compinitflaglint completion fish > ~/.config/fish/completions/flaglint.fishFish auto-sources files in ~/.config/fish/completions/ on startup — no extra configuration needed.
What Gets Completed
Section titled “What Gets Completed”- Subcommands —
audit,scan,migrate,validate,init,completion - Flags — all per-command flags and global flags (
--quiet,--verbose) - Flag values —
--formatvalues (json,markdown,html,sarif,text), completion shell names (bash,zsh,fish) - File arguments —
--output,--config,--baseline,--write-baselinecomplete against the filesystem
Examples
Section titled “Examples”# Print the bash completion scriptflaglint completion bash
# Activate immediately in the current bash sessionsource <(flaglint completion bash)
# Write the zsh completion script to the standard completions directoryflaglint completion zsh > ~/.zsh/completions/_flaglint
# Write the fish completion fileflaglint completion fish > ~/.config/fish/completions/flaglint.fishExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Script printed successfully. |
2 | No shell argument provided, or unsupported shell name. |