From e87a9b0a935868387226e9504d316db27649e6b0 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sun, 2 May 2021 01:50:30 -0500 Subject: [PATCH] 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. --- modules/completion/init.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index a216238..691a3e5 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -14,6 +14,13 @@ fi # Add zsh-completions to $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 #