From a338cba805f63f770e9078925bc5c46129e28bde Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Mon, 17 Dec 2018 14:10:51 -0600 Subject: [PATCH] python: Use brace expansion for pip compctl match Just use brace expansion only (and not a mix of brace expansion and path expansion) to expand `sed` match for more variants of 'pip*' (pip, pip2, pip3, pip2.7, pip3.7 etc.) in `compctl` assignment --- modules/python/init.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index a8e00b3..44043f1 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -160,7 +160,9 @@ if (( $#commands[(i)pip(|[23])] )); then || ! -s "$cache_file" ]]; then # pip is slow; cache its output. And also support 'pip2', 'pip3' variants $pip_command completion --zsh \ - | sed -e "s/\(compctl -K [-_[:alnum:]]*\) pip.*/\1 pip(|[23](|.[0-9]))/" >! "$cache_file" 2> /dev/null + | sed -e "s/\(compctl -K [-_[:alnum:]]* pip\).*/\1{,2,3}{,.{0..9}}/" \ + >! "$cache_file" \ + 2> /dev/null fi source "$cache_file"