Bash Completion
Tab completion for the shell

Installation

Completions for the command-line is provided via the bash-completion package which is available for most linux distros and macOS.
On macOS you can install it with brew:
1
$ brew install bash-completion
Copied!
on linux use the package manager of your distro.
Then add the completion file cmd/net to:
  • macOS: /usr/local/etc/bash_completion.d/
  • Linux: /etc/bash_completion.d/
and source it with:
  • macOS: . /usr/local/etc/bash_completion.d/net
  • Linux: . /etc/bash_completion.d/net
If you use zeus, simply execute the following in the project root to install the completion script:
1
$ zeus install-completions
Copied!
or move and source the file manually from the project root:
1
$ cp cmd/net /usr/local/etc/bash_completion.d/net && . /usr/local/etc/bash_completion.d/net
Copied!
Afterwards you should receive predictions when hitting tab in the shell, for subcommands and flags. For flags that expect a path on the filesystem, path completion is available and will only display files with the expected datatype (based on the file extension).
To use completion with zsh run the following:
1
autoload -U +X compinit && compinit
2
autoload -U +X bashcompinit && bashcompinit
3
cp cmd/net /usr/local/etc/bash_completion.d/net && . /usr/local/etc/bash_completion.d/net
Copied!
Last modified 1yr ago
Copy link