From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en58k-0004UQ-4H for guix-patches@gnu.org; Sat, 17 Feb 2018 11:15:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en58g-00056I-4U for guix-patches@gnu.org; Sat, 17 Feb 2018 11:15:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:40590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1en58f-00056D-Tn for guix-patches@gnu.org; Sat, 17 Feb 2018 11:15:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1en58f-0007mI-LQ for guix-patches@gnu.org; Sat, 17 Feb 2018 11:15:01 -0500 Subject: [bug#30495] [PATCH] bash completion: Complete files names after 'guix package -m'. Resent-Message-ID: From: Marius Bakke In-Reply-To: <87wozbtxhc.fsf@gmail.com> References: <20180217090738.6812-1-go.wigust@gmail.com> <87wozbtyah.fsf@fastmail.com> <87wozbtxhc.fsf@gmail.com> Date: Sat, 17 Feb 2018 17:14:48 +0100 Message-ID: <87tvuftwxz.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 Cc: 30495@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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--manife= st=3D=E2=80=99. > =E2=80=98--load-path=3D=E2=80=99 doesn't have a file completion too. Onl= y completion for > equal sign before. Oh, OK. That's another issue I guess. The patch below LGTM, but the commit message needs adjusting ;-) Thank you! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqIVPkACgkQoqBt8qM6 VPohmQf/YkA3GWRBjv+OGK4f77lIV7/5zWDqtrBltA73tKkCbpOS3zr34JCPF0Cs 9LuscYgL5kwpQgqwtupvvEoQdXHrUgdgRYZRgrp1NhKt+k0c53f9VntwoTn/lrID C/VLTYbZrh480OBtJxVL1v2K+xowDGprQh7bbEF18SgVhrXximmYkD1QVxKyAghC +02FQ0mSay+hzq2wukbgDBzjBxsDMcgSt6Fx3aYUN8T19iz/4Cmj+Nz+T7SsmBnG 3WSmIpqy/xBQvnB6tFU3miujlRWAD50mjuUIyu6I+p32HpmjZQjaJZwXT8pFpB/U 4RpR+SeqaflSYhNOA+sTBkjVEPQUkQ== =0tHR -----END PGP SIGNATURE----- --=-=-=--