1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-11-16 02:41:13 +00:00

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
This commit is contained in:
Indrajit Raychaudhuri 2018-12-17 14:10:51 -06:00
parent 0e6429da97
commit a338cba805

View File

@ -160,7 +160,9 @@ 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(|[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 fi
source "$cache_file" source "$cache_file"