From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3280D1393E9 for ; Thu, 5 Jun 2014 11:22:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DCE38E0A07; Thu, 5 Jun 2014 11:22:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 68932E0A07 for ; Thu, 5 Jun 2014 11:22:45 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4593233F8F8 for ; Thu, 5 Jun 2014 11:22:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 849CE182D4 for ; Thu, 5 Jun 2014 11:22:42 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1401967291.5df2ce07583dc623dd6b6caec17d9e73bfb47e1d.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: /, misc/ X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog misc/eselect.bashcomp X-VCS-Directories: / misc/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 5df2ce07583dc623dd6b6caec17d9e73bfb47e1d X-VCS-Branch: master Date: Thu, 5 Jun 2014 11:22:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0aa70330-17a0-4bff-9376-95fcec30a174 X-Archives-Hash: 7aa613f34f8878da98b4cd3af71ea929 commit: 5df2ce07583dc623dd6b6caec17d9e73bfb47e1d Author: Ulrich Müller gentoo org> AuthorDate: Thu Jun 5 11:21:31 2014 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Thu Jun 5 11:21:31 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=5df2ce07 eselect.bashcomp: Improve handling of options followed by an equals sign. * misc/eselect.bashcomp (_eselect): Improve handling of options that are followed by an equals sign. --- ChangeLog | 3 +++ misc/eselect.bashcomp | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3f0061..1f01c16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-06-05 Ulrich Müller + * misc/eselect.bashcomp (_eselect): Improve handling of options + that are followed by an equals sign. + * bin/eselect.in: Parse global options even if we are invoked as something-config or similar. Respect "--" to indicate end of options. diff --git a/misc/eselect.bashcomp b/misc/eselect.bashcomp index da3e55b..bd5afe3 100644 --- a/misc/eselect.bashcomp +++ b/misc/eselect.bashcomp @@ -8,7 +8,7 @@ _eselect() { local cur sedcmd2 sedcmd3 possibles - local options="--brief --color --colour" + local options="--brief --color= --colour=" COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" sedcmd2='s/^ \([[:alnum:]-][[:alnum:]_-]*\)[[:space:],].*$/\1/p' @@ -17,6 +17,7 @@ _eselect() { set -- "${COMP_WORDS[@]:1}" # skip global options while [[ $# -gt 1 && $1 == -* ]]; do + [[ $2 == "=" ]] && shift 2 shift done # skip any subaction options @@ -38,8 +39,10 @@ _eselect() { ;; esac - [[ -n "${possibles}" ]] && \ + if [[ -n "${possibles}" ]]; then COMPREPLY=( $(compgen -W "${possibles}" -- ${cur}) ) + [[ ${COMPREPLY[0]} == *= ]] && compopt -o nospace + fi return 0 }