aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar meka <meka@ns-linux.org> 2008-12-28 14:28:31 +0100
committerAvatar Ingmar Vanhassel <ingmar@exherbo.org> 2008-12-28 14:49:40 +0100
commit50f078c695d2e984a33f9912e8233268797cb154 (patch)
tree8b14a6d20a3ab0bf59f85b853121e37105584e70
parent397b27ba9af49e4e32a282b7894e233304c038b4 (diff)
downloadpaludis-50f078c695d2e984a33f9912e8233268797cb154.tar.gz
paludis-50f078c695d2e984a33f9912e8233268797cb154.tar.xz
zsh-completion: Don't complete package names when the current word starts with a hyphen.
Partial fix for ticket:670.
-rw-r--r--zsh-completion/_paludis_packages20
1 files changed, 11 insertions, 9 deletions
diff --git a/zsh-completion/_paludis_packages b/zsh-completion/_paludis_packages
index 35d4e30..2ed5941 100644
--- a/zsh-completion/_paludis_packages
+++ b/zsh-completion/_paludis_packages
@@ -7,15 +7,17 @@
local flags prepo packages categories paludis_pkgs
_paludis_packages_update_available() {
- if [[ $PREFIX != */* ]];then
- paludis_pkgs=(${(o)${${(M)${(f)"$(paludis --log-level silent --list-packages)"}:#\* *}##\* }##*/})
- _wanted paludis_pkgs expl "packages" compadd - ${(@)paludis_pkgs}
- categories=(${${(M)${(f)"$(paludis --log-level silent --list-categories)"}:#\* *}##\* })
- _wanted cat_packages expl "category/packages" compadd -S "/" $categories
- else
- compset -P '*/'
- packages=(${${${(M)${(f)"$(paludis --log-level silent --category ${IPREFIX//\//} --list-packages)"}:#\* *}##\* }//$IPREFIX/})
- _wanted cat_packages expl "category/packages" compadd ${(@)packages}
+ if [[ $PREFIX != -* ]]; then
+ if [[ $PREFIX != */* ]];then
+ paludis_pkgs=(${(o)${${(M)${(f)"$(paludis --log-level silent --list-packages)"}:#\* *}##\* }##*/})
+ _wanted paludis_pkgs expl "packages" compadd - ${(@)paludis_pkgs}
+ categories=(${${(M)${(f)"$(paludis --log-level silent --list-categories)"}:#\* *}##\* })
+ _wanted cat_packages expl "category/packages" compadd -S "/" $categories
+ else
+ compset -P '*/'
+ packages=(${${${(M)${(f)"$(paludis --log-level silent --category ${IPREFIX//\//} --list-packages)"}:#\* *}##\* }//$IPREFIX/})
+ _wanted cat_packages expl "category/packages" compadd ${(@)packages}
+ fi
fi
}