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 DB5E0138247 for ; Fri, 15 Nov 2013 06:21:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9752DE0A98; Fri, 15 Nov 2013 06:21:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 261EEE0A98 for ; Fri, 15 Nov 2013 06:21:10 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0153B33F213 for ; Fri, 15 Nov 2013 06:21:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 24A8DE530A for ; Fri, 15 Nov 2013 06:21:05 +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: <1384496345.14c4d2723db87329d23f40a7ed67cb44f9ced7fd.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: 14c4d2723db87329d23f40a7ed67cb44f9ced7fd X-VCS-Branch: master Date: Fri, 15 Nov 2013 06:21:05 +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: f993b887-5285-4c56-be23-a12a1a7bb6d1 X-Archives-Hash: 9e522b3c1b6f97aecadfb575b07e0efe Message-ID: <20131115062105.0Cxkdz63x6tmjxoALW3gaPQ9ysTl6u7PJA_Ctd0VyAM@z> commit: 14c4d2723db87329d23f40a7ed67cb44f9ced7fd Author: Ulrich Müller gentoo org> AuthorDate: Fri Nov 15 06:19:05 2013 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Fri Nov 15 06:19:05 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=14c4d272 Enable bash completion also for an empty list of words. * misc/eselect.bashcomp (_eselect): Suggest possible completions also for an empty list of words, i.e. when the user has not typed any parameters yet. --- ChangeLog | 6 ++++++ misc/eselect.bashcomp | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89fe111..16e368f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-11-15 Ulrich Müller + + * misc/eselect.bashcomp (_eselect): Suggest possible completions + also for an empty list of words, i.e. when the user has not typed + any parameters yet. + 2013-11-14 Michael Marineau * modules/profile.eselect (set_symlink): Silence profile symlink diff --git a/misc/eselect.bashcomp b/misc/eselect.bashcomp index 30972fe..0ffe628 100644 --- a/misc/eselect.bashcomp +++ b/misc/eselect.bashcomp @@ -13,18 +13,18 @@ _eselect() { sedcmd2='s/^ \([[:alnum:]-][[:alnum:]_-]*\)[[:space:],].*$/\1/p' sedcmd3='s/^ \[[[:digit:]][[:digit:]]*\] *\([[:graph:]]*\).*$/\1/p' - set - "${COMP_WORDS[@]:1}" + set -- "${COMP_WORDS[@]:1}" # skip global options while [[ $# -gt 1 && $1 == -* ]]; do shift done # skip any subaction options while [[ $# -gt 3 && $3 == -* ]]; do - set - "${@:1:2}" "${@:4}" + set -- "${@:1:2}" "${@:4}" done case $# in - 1) possibles="${options} $(eselect --brief modules list 2>/dev/null)" + 0|1) possibles="${options} $(eselect --brief modules list 2>/dev/null)" ;; 2) possibles=$(eselect --brief "$1" usage 2>/dev/null \ | sed -n -e "${sedcmd2}") ;;