From 27287b31e3f1819bb52e914228f53771632d7954 Mon Sep 17 00:00:00 2001 From: Jacek SowiƄski Date: Sat, 21 Apr 2012 23:41:13 +0200 Subject: 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 ` will complete pkgspec * `equery c -` will complete -h and --help * `equery c pkgspec ` will complete other options --HG-- extra : source : 1476935140c182f435d6de80dab035a931d5edb6 --- gentoo | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/gentoo b/gentoo index e93fd78..e30256d 100644 --- a/gentoo +++ b/gentoo @@ -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. -- cgit v1.2.3-65-gdbad