formatted consul completion and used helper function

pull/1782/head
Gurkirat Singh 2021-01-10 19:22:27 +05:30
parent 6e9fa193b7
commit 5be5d6933d
No known key found for this signature in database
GPG Key ID: CFD64E1DCB3DA835
1 changed files with 2 additions and 5 deletions

View File

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