From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en87b-0005Gt-Kc for guix-patches@gnu.org; Sat, 17 Feb 2018 14:26:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en87X-0008Ae-1A for guix-patches@gnu.org; Sat, 17 Feb 2018 14:26:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:40748) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en87W-0008AV-Sz for guix-patches@gnu.org; Sat, 17 Feb 2018 14:26:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1en87W-0004JI-Mk for guix-patches@gnu.org; Sat, 17 Feb 2018 14:26:02 -0500 Subject: bug#30495: [PATCH] bash completion: Complete files names after 'guix package -m'. Resent-To: guix-patches@gnu.org Resent-Message-ID: From: Oleg Pykhalov References: <20180217090738.6812-1-go.wigust@gmail.com> <87wozbtyah.fsf@fastmail.com> <87wozbtxhc.fsf@gmail.com> <87tvuftwxz.fsf@fastmail.com> Date: Sat, 17 Feb 2018 22:25:11 +0300 In-Reply-To: <87tvuftwxz.fsf@fastmail.com> (Marius Bakke's message of "Sat, 17 Feb 2018 17:14:48 +0100") Message-ID: <87o9knto4o.fsf@gmail.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: Marius Bakke Cc: 30495@debbugs.gnu.org, 30495-done@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Marius Bakke writes: > Oleg Pykhalov writes: > >> Marius Bakke writes: >> >>> 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? >> >> Nice catch! Thanks. >> >> But I don't know how to implement a file completion for =E2=80=98--manif= est=3D=E2=80=99. >> =E2=80=98--load-path=3D=E2=80=99 doesn't have a file completion too. On= ly completion for >> equal sign before. > > Oh, OK. That's another issue I guess. The patch below LGTM, but the > commit message needs adjusting ;-) Ouch, thank you for reminding. Pushed as f5f916792c7069a22d95c5b7c68bcf3bbb86e451 I'll close the bug report. Thanks, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlqIgZcACgkQckbhHGm3 lWkPdBAAhZUrVx8Lzk+YN24nHt/XUyx4vVsIpsxM8husADiXLw13EYJnTPV4nxLs jCgXIjVWtjQ8xiFjVraqqvnAv4Re/cnrZv/1xrGX+a882zAbLUc2K38fqT63f+6y I+yYXTR18mQVqM9ZoIGj7qDGsaF9cwImvoN8pU/yBO+bjxgEZqxefJRyqoTe7fwa ftNbGCmQH70rHLfxhxPsmqpR4FInYcg+56+QGhlr3RTyhAoIMaRTxJh88aUYl0ac Vmb8tDNcjfSBe9jxaZKd75R6NvhaaGCU5U2+Ce9K930fncMtkBzPnRQneyuhPwkm GBV7GyVHSRGESgpHzfshRlvV8zets+/NQDrf1hwLrQ+kb0b+ExvCU+JswNKV+Ubw wo6eZgUq9JIIIaS2HTELUE4pEoNOYY/y10uTu/oVHB3q0smE1z01JYM66uS/4Ghj K+3HbvASfvOvYnns7MqzfNZ/lMGr8sqaUoBbfiHrVWzb+NnadgDFbexAKWsAzh9t WRGEhYHNvcljBJN/ojDstnFSsRLkV2lZj3TSKAshVvdX3tO/iokqL9swakeW33/5 xnJ6mDaqNdNAhPRJIVVEvNfDEtlAcLyic5HmHg+eHFYlbUsG1CgtV+Auv6ecemhA JbbfCF2rU6ms0VmCfaSa5mXO9VutMcwvl0QfKx59cbxNKb/Ag+Q= =P0yQ -----END PGP SIGNATURE----- --=-=-=--