summaryrefslogtreecommitdiff
path: root/gentoo
diff options
context:
space:
mode:
authorJacek SowiƄski <mruwek.gentoo@vcf.pl>2012-04-21 19:47:00 +0200
committerJeremy Olexa <darkside@gentoo.org>2012-04-24 11:09:09 -0500
commit60fb879749f0e5d506f2ba4995d815b3d7f3392e (patch)
tree4fe8bac3b40e09d3e46072639deb0fc88f806c6a /gentoo
parentUpdate options completion for majority of equery modules (diff)
downloadgentoo-bashcomp-60fb879749f0e5d506f2ba4995d815b3d7f3392e.tar.gz
gentoo-bashcomp-60fb879749f0e5d506f2ba4995d815b3d7f3392e.tar.bz2
gentoo-bashcomp-60fb879749f0e5d506f2ba4995d815b3d7f3392e.zip
Fix completion for `equery belongs`
1. Remove -c and --category options as they are not present in `equery belongs --help` output. 2. Make code indentation more readable. 3. "Only complete if the previous entry on the command line is not a file name." now works properly also with options. --HG-- extra : source : 9f755f92ba552dcd20d20e473ff6cf5848c27e9e
Diffstat (limited to 'gentoo')
-rw-r--r--gentoo36
1 files changed, 11 insertions, 25 deletions
diff --git a/gentoo b/gentoo
index 2ae86f9..e93fd78 100644
--- a/gentoo
+++ b/gentoo
@@ -1177,31 +1177,17 @@ _equery()
b?(elongs))
# Only complete if the previous entry on the command line is not
# a file name.
- if \
- [[ \
- ${prev} == ${mode} || \
- ${prev:0:1} == "-" || \
- ${COMP_WORDS[COMP_CWORD-2]} == "-c" || \
- ${COMP_WORDS[COMP_CWORD-2]} == "--category" \
- ]] && \
- [[ \
- ${prev} != "-c" && \
- ${prev} != "--category" \
- ]]
- then
- case $cur in
- -*)
- COMPREPLY=($(compgen -W "-h --help -f --full-regex -e
- --early-out -n --name-only" -- $cur))
- ;;
- *)
- COMPREPLY=($(compgen -f -- $cur) \
- $(compgen -d -S '/' -- $cur))
- ;;
- esac
- # Are we completing a category?
- elif [[ ${prev} == "-c" || ${prev} == "--category" ]]; then
- COMPREPLY=($(builtin cd ${portdir}/metadata/cache; compgen -W "$(compgen -G '*')" -- $cur))
+ if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then
+ case $cur in
+ -*)
+ COMPREPLY=($(compgen -W "-h --help -f --full-regex -e
+ --early-out -n --name-only" -- $cur))
+ ;;
+ *)
+ COMPREPLY=($(compgen -f -- $cur) \
+ $(compgen -d -S '/' -- $cur))
+ ;;
+ esac
fi
;;
u?(ses))