From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emyUU-0005bA-Is for guix-patches@gnu.org; Sat, 17 Feb 2018 04:09:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emyUQ-0005cz-Ib for guix-patches@gnu.org; Sat, 17 Feb 2018 04:09:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:39570) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emyUQ-0005ct-Ek for guix-patches@gnu.org; Sat, 17 Feb 2018 04:09:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1emyUQ-0004Dx-7t for guix-patches@gnu.org; Sat, 17 Feb 2018 04:09:02 -0500 Subject: [bug#30495] [PATCH] bash completion: Complete files names after 'guix package -m'. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emyTT-0004zO-ES for guix-patches@gnu.org; Sat, 17 Feb 2018 04:08:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emyTP-00056Q-FX for guix-patches@gnu.org; Sat, 17 Feb 2018 04:08:03 -0500 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:40295) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emyTP-00055i-7T for guix-patches@gnu.org; Sat, 17 Feb 2018 04:07:59 -0500 Received: by mail-lf0-x22e.google.com with SMTP id 37so7041020lfs.7 for ; Sat, 17 Feb 2018 01:07:58 -0800 (PST) From: Oleg Pykhalov Date: Sat, 17 Feb 2018 12:07:38 +0300 Message-Id: <20180217090738.6812-1-go.wigust@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30495@debbugs.gnu.org * etc/completion/bash/guix (_guix_is_dash_L): Replace with ‘_guix_is_dash_L_or_m’. (_guix_complete): Add this. --- etc/completion/bash/guix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index 6b84193db..286c4f1c5 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -97,9 +97,10 @@ _guix_is_removing () $result } -_guix_is_dash_L () +_guix_is_dash_L_or_m () { - [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-L" ] \ + comp_words_minus_1="${COMP_WORDS[$COMP_CWORD - 1]}" + [ "$comp_words_minus_1" = "-L" ] || [ "$comp_words_minus_1" = "-m" ] \ || { case "${COMP_WORDS[$COMP_CWORD]}" in --load-path=*) true;; *) false;; @@ -149,7 +150,7 @@ _guix_complete () *) if _guix_is_command "package" then - if _guix_is_dash_L + if _guix_is_dash_L_or_m then _guix_complete_file elif _guix_is_removing -- 2.16.1