From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aMlJOXX/ZV8MBgAA0tVLHw (envelope-from ) for ; Sat, 19 Sep 2020 12:54:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id ABZfNXX/ZV8ZVAAA1q6Kng (envelope-from ) for ; Sat, 19 Sep 2020 12:54:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9D1B19402A7 for ; Sat, 19 Sep 2020 12:54:13 +0000 (UTC) Received: from localhost ([::1]:53710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJcNY-00028N-Kn for larch@yhetil.org; Sat, 19 Sep 2020 08:54:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJcNO-00028E-Tr for guix-patches@gnu.org; Sat, 19 Sep 2020 08:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34269) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJcNO-0000Ze-KI for guix-patches@gnu.org; Sat, 19 Sep 2020 08:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJcNO-0006v9-IV for guix-patches@gnu.org; Sat, 19 Sep 2020 08:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43509] [PATCH] bash completion: Fix completion for commands and subcommands. Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Sep 2020 12:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43509 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43509@debbugs.gnu.org Cc: Oleg Pykhalov X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160052000126554 (code B ref -1); Sat, 19 Sep 2020 12:54:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Sep 2020 12:53:21 +0000 Received: from localhost ([127.0.0.1]:45815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJcMj-0006uE-44 for submit@debbugs.gnu.org; Sat, 19 Sep 2020 08:53:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:47826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJcMh-0006u7-SU for submit@debbugs.gnu.org; Sat, 19 Sep 2020 08:53:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJcMh-0001ro-Jc for guix-patches@gnu.org; Sat, 19 Sep 2020 08:53:19 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:35668) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJcMf-0000Ws-Pw for guix-patches@gnu.org; Sat, 19 Sep 2020 08:53:19 -0400 Received: by mail-lf1-x129.google.com with SMTP id w11so9100669lfn.2 for ; Sat, 19 Sep 2020 05:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eFqvg93qKAMbdmCUv6T4/sE/mJuBRQw2hjdNxpFmiuU=; b=KUQ5D3gq/ViwkUylYyajtSH2MrcynqxEHQV06DqdiAGoSV9ayQVXidCvf/+JifOXBm b/OsylvFse0/iYqafNCEZDMewyCVeDWPO6fhJaT4rYf8EwvrgMBLyja7mNZhozZ3gGUH uEsCV/7ExAPQ/jZid0DVEe1FcJCVOXVPTfH/UPjTSom/ilYQh0ABsw0VdZxYMXVEcluR VjIOVMXLKn+1c90i62j7x5dns0UAlCe8cQdBzIBrLak+wEonhHQnlwCPyLwxcYV1Uqcw 7oMZdtMtYyXrQ1gUup2BjgVTEUamJdgd7UupEaOFsOW/RqdhBg2/ROlBM0Msj0zgxzBQ oUkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eFqvg93qKAMbdmCUv6T4/sE/mJuBRQw2hjdNxpFmiuU=; b=K4YV22jeKE8UdiLyCnIBHsbxSxwrkzYZKL/B/y1LE03pHZNzT1wCK+tXeoCBfwAM2R mfqIn2vD2c6K03bMOvgNfHxCyst4uEEnSLpl2GyRY8F6jTFwo059Qr4N3iVtZAQFFSmW JFBO4LEXRrv0ZZjKeFX6Yai9NGmGjWMQOWgOLoTU34IsFfXtOC3OmkpQcrPuieIfjF7Q BFgv0XL1m+sq4FXhyVpEHm0pI+wzm4UGYYA2qnjveyCIokPkat5GfOT8EpCBrn9FizYX QbzoIfV+zdPqAxLFd5T4wp4ZzrGY7/SiUqjP/nuf8fVmuEbx16y5Z8oW5CT/He1bEQrr DPvg== X-Gm-Message-State: AOAM532sp6AtfgCFdA7yK1Zz1579HpiEuvBiFV0j1tNjH8vHhxnUMvvv xcNvgjbhdNs5MdZ2h/SqeR+IPPcEaYY= X-Google-Smtp-Source: ABdhPJx/Rx2ApOJqh6qtYhDh2dBTz0BsJeeYN80jPdCi6FaY8VIVzS0fLK60O3WYmjW5p5kxqWoTcA== X-Received: by 2002:ac2:511a:: with SMTP id q26mr11372302lfb.466.1600519993159; Sat, 19 Sep 2020 05:53:13 -0700 (PDT) Received: from localhost.localdomain (95-55-4-176.dynamic.avangarddsl.ru. [95.55.4.176]) by smtp.gmail.com with ESMTPSA id 187sm1265247lfn.129.2020.09.19.05.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 05:53:12 -0700 (PDT) From: Oleg Pykhalov Date: Sat, 19 Sep 2020 15:52:51 +0300 Message-Id: <20200919125251.3124-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=go.wigust@gmail.com; helo=mail-lf1-x129.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=KUQ5D3gq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 4.09 X-TUID: REhWdAJ60v8n * etc/completion/bash/guix (_guix_complete_command, _guix_complete_subcommand): Fix completion. --- etc/completion/bash/guix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index 98d20484f7..3bc9a48947 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -27,8 +27,7 @@ _guix_complete_command () if [ -z "$_guix_commands" ] then # Cache the list of commands to speed things up. - _guix_commands="$(guix --help 2> /dev/null \ - | grep '^ ' | cut -c 2-)" + _guix_commands="$(guix --help 2> /dev/null | awk '/^ [a-z]/ { print $1 }')" fi COMPREPLY=($(compgen -W "$_guix_commands" -- "$word_at_point")) } @@ -36,9 +35,7 @@ _guix_complete_command () _guix_complete_subcommand () { local command="${COMP_WORDS[1]}" - local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null \ - | grep '^ [a-z]' \ - | sed -e's/^ \+\([a-z-]\+\).*$/\1/g')" + local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null | awk '/^ [a-z]/ { print $1 }')" COMPREPLY=($(compgen -W "$subcommands" -- "${COMP_WORDS[$COMP_CWORD]}")) } -- 2.28.0