diff options
Diffstat (limited to 'scripts/zsh_autocomplete.sh')
| -rw-r--r-- | scripts/zsh_autocomplete.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/zsh_autocomplete.sh b/scripts/zsh_autocomplete.sh index 898210b951..b027571379 100644 --- a/scripts/zsh_autocomplete.sh +++ b/scripts/zsh_autocomplete.sh @@ -1,10 +1,12 @@ _rabbitmqctl_complete() { - local word completions a - local LANG=en_US.UTF-8 - read -cl a - word="$1" - completions="$(export LANG=en_US.UTF-8; export LC_CTYPE=en_US.UTF-8; /usr/lib/rabbitmq/bin/rabbitmqctl --auto-complete ${=a})" - reply=( "${(ps:\n:)completions}" ) + if [ -x /usr/lib/rabbitmq/bin/rabbitmqctl ]; then + local word completions a + local LANG=en_US.UTF-8 + read -cl a + word="$1" + completions="$(export LANG=en_US.UTF-8; export LC_CTYPE=en_US.UTF-8; /usr/lib/rabbitmq/bin/rabbitmqctl --auto-complete ${=a})" + reply=( "${(ps:\n:)completions}" ) + fi } compctl -f -K _rabbitmqctl_complete rabbitmqctl |
