snapdir autocomplete

Generate a shell completion script.

autocomplete writes a completion script for the requested shell to stdout. The script always targets the snapdir binary name. The hidden completions <shell> alias remains for back-compat with existing release and asset-generation scripts, and emits byte-identical output, but autocomplete is the documented command.

Usage

snapdir autocomplete [OPTIONS] <SHELL>

Arguments

Argument Description
<SHELL> Target shell: bash, zsh, fish, powershell, or elvish.

Examples

Load completions in bash:

eval "$(snapdir autocomplete bash)"

Load completions in zsh:

eval "$(snapdir autocomplete zsh)"

Load completions in fish:

snapdir autocomplete fish | source

Load completions in PowerShell:

snapdir autocomplete powershell | Out-String | Invoke-Expression

Load completions in Elvish:

eval (snapdir autocomplete elvish | slurp)

See also