Shell completion
What it is
Section titled “What it is”Tab completes wdx’s commands and flags, and the values of flags: project names from the daemon, directories for --local and --path, help topics after wdx help. The installer sets it up for every shell it finds. wdx completion <shell> prints the script, for setting it up by hand.
Try it
Section titled “Try it”Type wdx project open --name and press Tab: the projects wdx knows are offered. Set it up by hand, if the installer did not:
# bash, in ~/.bashrcsource <(wdx completion bash)
# zsh: save it in a directory of your fpath, before compinit in ~/.zshrcmkdir -p ~/.zsh/completionswdx completion zsh > ~/.zsh/completions/_wdx# fpath=(~/.zsh/completions $fpath)
# fishwdx completion fish > ~/.config/fish/completions/wdx.fishHow it behaves
Section titled “How it behaves”- Where the installer puts it. bash:
~/.local/share/bash-completion/completions/wdx, loaded by the bash-completion package. zsh: Homebrew’ssite-functions/_wdxwhen it is writable, else~/.zsh/completions/_wdx. fish:~/.config/fish/completions/wdx.fish. It never edits your shell’s startup files: when one needs a line, it prints it. - Always current. The scripts ask
wdxfor the candidates on every Tab, so new commands and flags complete without installing them again.scripts/install.sh --completionsinstalls them again, after installing a new shell for instance. - Never in the way. A completion that asks the daemon waits at most half a second and offers nothing when it does not answer. It never prompts, and is logged at debug level only.
- Suggestions in grey as you type come from the shell, fish’s built in or zsh’s zsh-autosuggestions plugin, and draw on these completions with nothing more to set up.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
wdx completion bash | Print the bash completion script |
wdx completion zsh | Print the zsh completion script |
wdx completion fish | Print the fish completion script |