diff options
author | 2012-04-21 23:41:13 +0200 | |
---|---|---|
committer | 2012-04-24 11:09:09 -0500 | |
commit | 27287b31e3f1819bb52e914228f53771632d7954 (patch) | |
tree | 35a23973afa33f3c33589a7cd5d96edecc5e67b5 | |
parent | Fix completion for `equery belongs` (diff) | |
download | gentoo-bashcomp-27287b31e3f1819bb52e914228f53771632d7954.tar.gz gentoo-bashcomp-27287b31e3f1819bb52e914228f53771632d7954.tar.bz2 gentoo-bashcomp-27287b31e3f1819bb52e914228f53771632d7954.zip |
Completion for `equery changes` 1. There is inconsitency in output of `equery changes --help`: * "Usage" and "examples" give different order of args. * In "Usage" it is: [options] pkgspec * In "examples" it is: pkgspec [options] 2. I chose "examples" approach so: * `equery c <TAB><TAB>` will complete pkgspec * `equery c -<TAB><TAB>` will complete -h and --help * `equery c pkgspec <TAB><TAB>` will complete other options
--HG--
extra : source : 1476935140c182f435d6de80dab035a931d5edb6
-rw-r--r-- | gentoo | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -1118,10 +1118,29 @@ _equery() ;; esac ;; - c?(hanges)|a|glsa|t|stats) + a|glsa|t|stats) # These commands have not been implemented in 'equery' yet ... echo -n "# Not implemented! " ;; + c?(hanges)) + # Complete package name only if it is not yet supplied. + if [[ ${prev} == ${mode} ]]; then + case $cur in + -*) + COMPREPLY=($(compgen -W "-h --help" -- $cur)) + ;; + *) + _pkgname -A $cur + ;; + esac + else + case $cur in + *) + COMPREPLY=($(compgen -W "-h --help -l --latest -f --full --limit --from --to" -- $cur)) + ;; + esac + fi + ;; f?(iles)) # Only complete if the previous entry on the command line is not # a package name. |