Skip to content

Commit 5c57e73

Browse files
committed
Merge branch 'aik099-56-unable-to-install-on-osx-snow-leopard'
2 parents c7b9c45 + b9ca44b commit 5c57e73

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/HookFactory.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ function %%function_name%% {
6464
__ltrim_colon_completions "$cur";
6565
};
6666
67-
complete -F %%function_name%% "%%program_name%%";
67+
if [ "$(type -t _get_comp_words_by_ref)" == "function" ]; then
68+
complete -F %%function_name%% "%%program_name%%";
69+
else
70+
>&2 echo "Completion was not registered for %%program_name%%:";
71+
>&2 echo "The 'bash-completion' package is required but doesn't appear to be installed.";
72+
fi
6873
END
6974

7075
// ZSH Hook
@@ -169,7 +174,7 @@ protected function generateFunctionName($programPath, $programName)
169174

170175
/**
171176
* Make a string safe for use as a shell function name
172-
*
177+
*
173178
* @param string $name
174179
* @return string
175180
*/

0 commit comments

Comments
 (0)