Paket shell completion for bash
- Download the
paket-completion.bashfile to a subdirectory of your home directory, preferably a directory with other function files. sourcethe file in your~/.bashrc.
$ target="$HOME/.bash-completions/paket-completion.bash"
$ mkdir "$(dirname "$target")"
$ curl --fail --location --proto-redir -all,https --output "$target" \
https://raw.githubusercontent.com/fsprojects/Paket/master/completion/paket-completion.bashIn your ~/.bashrc:
source "$HOME/.bash-completions/paket-completion.bash"- Download the
paket-completion.bashfile to/etc/bash_completion.d/. - Restart your shell.
$ target="/etc/bash_completion.d/paket-completion.bash"
$ curl --fail --location --proto-redir -all,https --output "$target" \
https://raw.githubusercontent.com/fsprojects/Paket/master/completion/paket-completion.bashJust repeat the download from above.
Alternatively the completion script comes bundled with the
paket-completion-update function that will download the current
paket-completion.bash to the same file as above, even if you changed its
location after the initial download.
Please note: The paket-completion-update function requires the completion
script to be sourced and curl to be installed.
paket-completion-update supports an optional first parameter that allows you
to override the default download root URL which is
https://raw.githubusercontent.com/fsprojects/Paket/master/completion.
For easier consumption of Paket (without paket.sh or paket.cmd) it is
advised to create an alias and always run Paket from the repository root.
Also have a look at Paket's magic mode.
Somewhere in your ~/.bashrc:
if [[ "$OS" != Windows* ]]; then
alias paket='mono ./.paket/paket.exe'
else
alias paket='./.paket/paket.exe'
fi
# Complete the paket alias using the _paket function.
complete -F _paket paket