Shell Completion
Shadowtree can generate bash, fish, and zsh completion.
Install Completion
Bash:
command -v shadowtree >/dev/null 2>&1 && eval "$(shadowtree completion bash)"
Fish:
shadowtree completion fish > ~/.config/fish/completions/shadowtree.fish
Zsh:
command -v shadowtree >/dev/null 2>&1 && eval "$(shadowtree completion zsh)"
The repository install recipe appends guarded eval lines for bash and zsh and
installs fish completion when fish is available.
Dynamic Completion
Generated shell scripts call back into Shadowtree:
shadowtree __complete fish <words...>
shadowtree __complete bash <cursor> <line> [current]
shadowtree __complete zsh <words...>
Completion uses:
- configured recipes
- built-in recipes from the selected profile
- built-ins from a detected profile when no config is loaded
- recipe
helptext - typed argument metadata
valuesproviders for the active argument
Supported Behavior
shadowtree <TAB>completes core commands and resolved recipes.shadowtree te<TAB>completes matching recipe names such astest.shadowtree help <TAB>completes recipe names.shadowtree help test <TAB>completescolor=false.shadowtree --profile <TAB>completesgoandnode.shadowtree build <TAB>completes configured recipe arguments such asproject=.shadowtree benchmark preset=<TAB>completes recipe-local preset names.shadowtree build[<TAB>completes bracket-style arguments such asbuild[project=.shadowtree test race=<TAB>completestrueandfalsefor bool arguments.patharguments complete relative paths, absolute paths, and~/paths.rel_patharguments complete relative paths only.path_kindfilters path candidates to files, directories, or executable files.
Completion parses config, checks profile markers, and runs only argument
values commands needed for the active argument.