From 313c70f396b29374297f85cb329a5a0d3e4876e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20Sowi=C5=84ski?= Date: Tue, 24 Apr 2012 14:30:19 +0200 Subject: [PATCH 3/4] Experimental changes in resolving atoms preceded by equal-sign 1. Don't look for version unless user explicitly wants to do that. 2. Fix automatic add of '=' in front of the atom - no more duplicated equal signs. 3. Test this approach on `equery files` for the start ;) --HG-- extra : rebase_source : 921cddb6de25799893829a4bbc370f785bcb27ce --- gentoo | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gentoo b/gentoo index 417a902..5176041 100644 --- a/gentoo +++ b/gentoo @@ -104,7 +104,7 @@ _pkgname() # When we've completed most of the name, also display the version for # possible completion. if [[ ${#COMPREPLY[@]} -le 1 || ${cur:${#cur}-1:1} == "-" ]] && - [[ ${cur} != */ ]]; then + [[ ${cur} != */ && ${prev} == '=' ]]; then # The portage cache is appropriate to complete specific versions from. COMPREPLY=(${COMPREPLY[@]} $(\ for pd in ${portdir} ; do \ @@ -156,7 +156,7 @@ _pkgname() esac # 'equery' wants an '=' in front of specific package versions. # Add it if there is only one selected package and it isn't there already. - if [[ ${#COMPREPLY[@]} == 1 && ${COMP_WORDS[COMP_CWORD]:0:1} != "=" ]] + if [[ ${#COMPREPLY[@]} == 1 && ${prev} != "=" ]] then [[ -z "${only}" ]] && COMPREPLY=("="$COMPREPLY) fi @@ -1164,7 +1164,7 @@ _equery() f?(iles)) # Only complete if the previous entry on the command line is not # a package name. - if [[ ${prev} == ${mode} || ${prev:0:1} == "-" ]]; then + if [[ ${prev} == ${mode} || ${prev:0:1} == "-" || ${prev} == '=' ]]; then # --filter=: completion of the files types list if [[ ${prev} == "-f" || "${cur}" == "--filter="* ]] ; then COMPREPLY=($(_list_compgen "${cur#--filter=}" , \ -- 1.7.3.4