From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en4gf-0005tc-NE for guix-patches@gnu.org; Sat, 17 Feb 2018 10:46:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en4gc-0000nm-Iv for guix-patches@gnu.org; Sat, 17 Feb 2018 10:46:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:40565) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en4gc-0000ng-D4 for guix-patches@gnu.org; Sat, 17 Feb 2018 10:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1en4gc-000720-6j for guix-patches@gnu.org; Sat, 17 Feb 2018 10:46:02 -0500 Subject: [bug#30495] [PATCH] bash completion: Complete files names after 'guix package -m'. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20180217090738.6812-1-go.wigust@gmail.com> References: <20180217090738.6812-1-go.wigust@gmail.com> Date: Sat, 17 Feb 2018 16:45:42 +0100 Message-ID: <87wozbtyah.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Oleg Pykhalov , 30495@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Oleg Pykhalov writes: > * etc/completion/bash/guix (_guix_is_dash_L): Replace with > =E2=80=98_guix_is_dash_L_or_m=E2=80=99. > (_guix_complete): Add this. [...] > 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 > } >=20=20 > -_guix_is_dash_L () > +_guix_is_dash_L_or_m () > { > - [ "${COMP_WORDS[$COMP_CWORD - 1]}" =3D "-L" ] \ > + comp_words_minus_1=3D"${COMP_WORDS[$COMP_CWORD - 1]}" > + [ "$comp_words_minus_1" =3D "-L" ] || [ "$comp_words_minus_1" =3D "-= m" ] \ > || { case "${COMP_WORDS[$COMP_CWORD]}" in > --load-path=3D*) true;; > *) false;; I think this fails to account for the long form "--manifest". Perhaps it's better to add a new "_guix_is_dash_m" and use "if _guix_is_dash_L || _guix_is_dash_m" below. WDYT? > @@ -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 > --=20 > 2.16.1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqITicACgkQoqBt8qM6 VPrg4AgAq2dX3qvqznJ5nGG/O9C7PWQ+YiZS2EIRU97IhkmfOiu2lLFTDdk14FLH r7PqfWVjtJK9iav/H6LMB1dZYDYk3w9Yoce4yUtzP2XKH2sZbblFZHfjFPKpLZ1a C8N3zK73s+XZALSp5Nrd/1u7JizO+BuwdLso/QrdGKms7IJ1Ry5N6pMet/4H2frG oiBgUu7FXCnykn7WjldCDxKwBvtGUc1yxA4xtLfG18iGsgNRmgo/8Jr2utRxIV5G yBnDECF9AuxSbwCaia8bOBenRDjs/PDpWQN5I8fekhB7LlCBW0QpBBqnqVCVKz5c 4FW+t26JXqMj8dKG9cUm+zgTyFbJog== =ebm1 -----END PGP SIGNATURE----- --=-=-=--