completion: Add completion for keg-only brewed curl when available

As curl bundled with macOS does not include `_curl` definitions, one
way to make `_curl` available is to install curl from Homebrew.

However, since curl from Hombrew is _keg-only_, its function path needs
to be explicitly included.
main
Indrajit Raychaudhuri 4 years ago committed by Indrajit Raychaudhuri
parent 509c5ca80f
commit e87a9b0a93

@ -14,6 +14,13 @@ fi
# Add zsh-completions to $fpath. # Add zsh-completions to $fpath.
fpath=("${0:h}/external/src" $fpath) fpath=("${0:h}/external/src" $fpath)
# Add completion for keg-only brewed curl when available.
if (( $+commands[brew] && ! $+functions[_curl] )) && \
[[ -d "${curl_prefix::="$(brew --prefix curl 2> /dev/null)"}" ]]; then
fpath=("${curl_prefix}/share/zsh/site-functions" $fpath)
unset curl_prefix
fi
# #
# Options # Options
# #

Loading…
Cancel
Save