Browse Source

python: Fix pip compctl file match pattern

Make `sed` match more reliable while replacing the whole of 'pip*' with 
'pip pip2 pip3' for `compctl` assignment
master
Indrajit Raychaudhuri 6 years ago committed by GitHub
parent
commit
3aec8e1944
  1. 2
      modules/python/init.zsh

2
modules/python/init.zsh

@ -160,7 +160,7 @@ if (( $#commands[(i)pip(|[23])] )); then
|| ! -s "$cache_file" ]]; then || ! -s "$cache_file" ]]; then
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants # pip is slow; cache its output. And also support 'pip2', 'pip3' variants
$pip_command completion --zsh \ $pip_command completion --zsh \
| sed -e "s|\(compctl -K [-_[:alnum:]]*\) pip|\1 pip pip2 pip3|" >! "$cache_file" 2> /dev/null | sed -e "s|\(compctl -K [-_[:alnum:]]*\) pip.*|\1 pip pip2 pip3|" >! "$cache_file" 2> /dev/null
fi fi
source "$cache_file" source "$cache_file"

Loading…
Cancel
Save