formatted consul completion and used helper function

This commit is contained in:
Gurkirat Singh
2021-01-10 19:22:27 +05:30
committed by Noah Gorny
parent 284819e718
commit 846a576978
2 changed files with 6 additions and 8 deletions

View File

@@ -1,10 +1,7 @@
# bash completion support for Hashicorp consul
# shellcheck shell=bash
cite "about-completion"
about-completion "Hashicorp consul completion"
CONSUL_BIN=$(command -v consul 2>/dev/null)
if [[ -x "$CONSUL_BIN" ]]
then
complete -C "$CONSUL_BIN" consul
if _command_exists consul; then
complete -C "$(which consul)" consul
fi
unset CONSUL_BIN