summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Sowiński <mruwek.gentoo@vcf.pl>2012-04-21 19:01:05 +0200
committerJeremy Olexa <darkside@gentoo.org>2012-04-24 11:09:09 -0500
commit1656f36e346d8d19255291a8d35006a7d15c1d28 (patch)
tree5ed7f6ce04255bfcb0a7962f4bf2bf1856f39249
parentMake the dist and tag target git compatible (diff)
downloadgentoo-bashcomp-1656f36e346d8d19255291a8d35006a7d15c1d28.tar.gz
gentoo-bashcomp-1656f36e346d8d19255291a8d35006a7d15c1d28.tar.bz2
gentoo-bashcomp-1656f36e346d8d19255291a8d35006a7d15c1d28.zip
#350179 fix the completion for 'uses' and 'which' modules of equery
- fix pkgspec completion - separate completion for these modules, as they have another sets of options
-rw-r--r--gentoo31
1 files changed, 26 insertions, 5 deletions
diff --git a/gentoo b/gentoo
index bb253bc..1d38106 100644
--- a/gentoo
+++ b/gentoo
@@ -1200,13 +1200,34 @@ _equery()
COMPREPLY=($(builtin cd ${portdir}/metadata/cache; compgen -W "$(compgen -G '*')" -- $cur))
fi
;;
- @(u?(ses)|w?(hich)))
+ u?(ses))
# Only complete if the previous entry on the command line is not
# a package name.
- if [[ ${prev} == ${mode} ]]; then
- # Complete on all package names.
- _pkgname -A $cur
- COMPREPLY=($(compgen -W "${COMPREPLY[@]} --help" -- ${cur}))
+ if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "-h --help -a --all" -- $cur))
+ ;;
+ *)
+ # Complete on all package names.
+ _pkgname -A $cur
+ ;;
+ esac
+ fi
+ ;;
+ w?(hich))
+ # Only complete if the previous entry on the command line is not
+ # a package name.
+ if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "-h --help -m --include-masked" -- $cur))
+ ;;
+ *)
+ # Complete on all package names.
+ _pkgname -A $cur
+ ;;
+ esac
fi
;;
g|depgraph)