Rendered from docs/interfaces/headwater-completions.md in the Headwater
corpus. Every document on this half of the site is typed by the taxonomy
the descriptor names: corpus.json.
headwater completions
Synopsis
headwater completions <shell>
The command writes one completion script to standard output for bash, zsh, fish or powershell. It writes no file itself.
Description
headwater completions <shell> generates a script from the same command tree that parses the binary and that headwater help prints. The script includes every verb, grouped second word and option in that tree.
Redirect standard output to the file and load it with the shell's normal command. For example, headwater completions bash > f && . f loads the Bash script in the current shell.
The command does not load the corpus or the taxonomy lock. It answers from the binary, so it works from a directory that is not a repository.
Preconditions
The selected shell must be available to the caller when the caller loads the script. The binary itself does not start that shell.
Options
| Option | What it does |
|---|---|
<shell> |
Select bash, zsh, fish or powershell. |
--root <path> |
Accept the repository path for the global parser. Completion generation does not read it. |
--wide |
Refused. A completion script renders no help, and it carries no layout of this engine. |
--no-color |
Force plain text on both streams: bold and dim weight plus glyphs, no escape sequence. The default already senses whether each stream is a terminal, and renders color only there. |
--no-banner |
Suppress the masthead: the line naming this binary and its version, that the root help screen alone prints. It is accepted here and does nothing, since only the root screen prints one. |
The global --help and --version flags are answered before this command runs. The global --root, --no-color and --no-banner flags are accepted and have no effect: completion scripts carry no color and print no masthead of their own. --wide is refused because a completion script renders no help. Each description reaches the shell on one line, and the shell lays out the listing it shows. An option that belongs to another verb is refused.
Exit status
0 when the selected shell is one of the four supported shells and the script is generated. The script is on standard output, and standard error is empty.
1 when the shell is omitted, the shell name is not supported, or the command line has an invalid option or extra word. The refusal names the supported shells and writes no script.
1, and never 101, when standard output or standard error cannot be written, and one sentence on standard error names a failed standard output.
Environment
No environment variable reaches the command. The command tree is the only input, so the bytes of the script do not move with the terminal of the caller.
Files
None. The command reads no repository file and writes no file. The caller chooses the output path by redirecting standard output.
See also
headwater help prints the same command tree for a person.
headwater --help is the root command grammar from which the script is generated.
headwater check documents a command whose options and status do read a corpus.