From 66da7113345261f633ea298dc4c8c4c76488fef0 Mon Sep 17 00:00:00 2001 From: Lucy Davies Date: Mon, 5 Jun 2017 16:18:07 +0100 Subject: [PATCH] __ltrim_colon_completions is not always available on macOS (#459) * __ltrim_colon_completions is not always available on macOS, so bash-completion should check first --- bash_completions.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bash_completions.go b/bash_completions.go index 5d6238b2..e0cfb349 100644 --- a/bash_completions.go +++ b/bash_completions.go @@ -132,7 +132,10 @@ __handle_reply() declare -F __custom_func >/dev/null && __custom_func fi - __ltrim_colon_completions "$cur" + # available in bash-completion >= 2, not always present on macOS + if declare -F __ltrim_colon_completions >/dev/null; then + __ltrim_colon_completions "$cur" + fi } # The arguments should be in the form "ext1|ext2|extn"