From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19065 invoked from network); 15 Dec 2020 21:41:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 15 Dec 2020 21:41:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1608068474; b=vdSRMB3iMeBMvGmjenAbC6Yt5itd3U1vKz/MmhkCMvrk2snOvWFtMUMTqPi35vjPW00T16pkdd bH8xNrD1O+GKcAHYPNZOAk1fNyk1Ikb+J1px1+i7T77AjDygmWjqX4jhqpMo8Dcfeoy1lNPJl4 n6gTw4t+Ibe6c5+kdefQ1S3SKYjxNXKo81eZ2NOaIm+waE/rwspYeHG9E+jh748i3ckCZ7T+aL JL41m+6xCFrSoHvdG0OQgSuqubSrBdk8lFPRCrb1kdDxRDmboEwnFCHc+L5CmmG+WIZCzFbKzA JmWI08DSI45wGGWoTOH17Q8bZ76+4HMcBNH4h/3YGjC0xw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (s1.jo-so.de) smtp.remote-ip=37.221.195.157; dmarc=none header.from=jo-so.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1608068474; bh=n1dPLrTCLAFkk9wwaZk4FuEvGIul5DB9hdFymUWGSoA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature; b=s6leZLBGwM/v9ABy4ix2cQ1p2ZLcgSWOqNyOEcHwFdNDJ+VZYT1+a4c4ZQdJA8LLeBkv3GA4yX YGGgGZ5xa2IVotmd1ebdxw3UbOdYN1tUEcF9mezxuuNGdKHogh5p0/Ng5kajP29LVZI8BeRh3y GadZdkFWbsnC/I6zg2P4DvTRi0J8d2h1LzY1zG50Ky1inxo0+7hL4nGcDU+/OjW1KZmvs7yyz2 LOw5sXvYB0NPPos449sisEa91b5NecWINHJyP6Cmvjenju4iqek5c8QzDzk3yXc9ZCjl/E5xwe lyyWQ35THkdNJZLVWfFSNJErNRe7dGzjLwHtM51VH9yEVA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=n9V0ZfgG9G5xGMI0fkyvErAJ2hkkDofMFyCMlK7Ld4s=; b=ZR4QYdTXCOBWvkOHkpoQRs9HQe mNHaRW2BYweHtlOKm9VEmSh387G/74MlBumsje64urTaocFus1F7KfyQWgvxHjI8/ZSCFNdbIfAaC prJf+gLRDEF8xYa21Iv3UdlSWF2rUvhB86HjZ1Hq7MRRzg2TVYl+kr5AYBl7gv0i6lTtGjNVB99VM VBMZ8SVQXQOVcsUKiSh0iRR+bWkvC5hyUVSm2TDBSfRGHSUX7AmW1PtoeQN2S2TkqoGAw2444B+ky EVZmoJOZoE0TCbsvg75TDwVCUbVqt344eDynpLyF6TqbUVDm/3DFIBjcBB1PYlgC9BI6w4Pd0bvdD Anjx6EJg==; Received: from authenticated user by zero.zsh.org with local id 1kpI48-000Due-5r; Tue, 15 Dec 2020 21:41:04 +0000 Authentication-Results: zsh.org; iprev=pass (s1.jo-so.de) smtp.remote-ip=37.221.195.157; dmarc=none header.from=jo-so.de; arc=none Received: from s1.jo-so.de ([37.221.195.157]:51077) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kpI3b-000DFG-3m; Tue, 15 Dec 2020 21:40:31 +0000 Received: from mail-relay (helo=jo-so.de) by s1.jo-so.de with local-bsmtp (Exim 4.92) (envelope-from ) id 1kpI3a-0002f4-Ln; Tue, 15 Dec 2020 22:40:30 +0100 Received: from joerg by zenbook.jo-so.de with local (Exim 4.94) (envelope-from ) id 1kpI3X-00B4E7-S1; Tue, 15 Dec 2020 22:40:27 +0100 Date: Tue, 15 Dec 2020 22:40:27 +0100 From: =?utf-8?B?SsO2cmc=?= Sommer To: Peter Stephenson Cc: zsh-users@zsh.org Subject: Re: How to get all tagets for rake completion? Message-ID: <20201215214027.a3htwtas6su3fhz5@jo-so.de> OpenPGP: id=7D2C9A23D1AEA375; url=https://jo-so.de/pgp-key.txt; preference=signencrypt References: <20201215125724.b6qdvvuhr2mwpxbz@jo-so.de> <1047872238.2253883.1608052325319@mail2.virginmedia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="azfitzhyxxtpyuft" Content-Disposition: inline In-Reply-To: <1047872238.2253883.1608052325319@mail2.virginmedia.com> X-Seq: 26230 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --azfitzhyxxtpyuft Content-Type: multipart/mixed; protected-headers=v1; boundary="4chybzaay4qmmegp" Content-Disposition: inline Subject: Re: How to get all tagets for rake completion? MIME-Version: 1.0 --4chybzaay4qmmegp Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Peter Stephenson schrieb am Di 15. Dez, 17:12 (+0000): > > On 15 December 2020 at 12:57 J=F6rg Sommer wrote: > > I would like to get all targets for the completion of rake arguments. H= ow > > can I inject an argument to the targets query call or how to replace it= ? I > > have to pass `-A` to *rake* to get the arguments for the completion. >=20 > Frankly, your best bet is probably just to copy the distributed _rake > function and adapt it, copying it to somewhere early in your $fpath. > You'll see towards the end an extremely complicated line with "-sT" in > the middle --- just change that to "-sTA". >=20 > I have a feeling it might be possible to set a style so that the > _call_program helper does something different for you, but I'm not > sure there's any benefit in being too clever here. The _rake completer > doesn't change very often, I don't think. >=20 > (This could be made a style for the _rake completer easily enough, > in fact.) What do you think about the attached commit? Is it fine or should I change anything? J=F6rg --=20 Was ist das blo=DF f=FCr eine Welt, in der es mehr Mut braucht ehrlich zu weinen als St=E4rke vorzut=E4uschen? --4chybzaay4qmmegp Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Completion-_rake-add-zsytle-for-targets-without-desc.patch" Content-Transfer-Encoding: quoted-printable =46rom 640e40dc81833624281f5c146b514417f251b4c3 Mon Sep 17 00:00:00 2001 Message-Id: <640e40dc81833624281f5c146b514417f251b4c3.1608068274.git.joerg@= jo-so.de> =46rom: =3D?UTF-8?q?J=3DC3=3DB6rg=3D20Sommer?=3D Date: Tue, 15 Dec 2020 22:32:46 +0100 Subject: [PATCH] Completion/_rake: add zsytle for targets without descripti= on `rake -T` shows only these targets having a description. But it might be useful to see all. Allow this with the zsytle setting: zstyle :completion::complete:rake:argument-rest all-targets true --- Completion/Unix/Command/_rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Completion/Unix/Command/_rake b/Completion/Unix/Command/_rake index 8814edaa5..88c25d7cf 100644 --- a/Completion/Unix/Command/_rake +++ b/Completion/Unix/Command/_rake @@ -37,7 +37,9 @@ case "$state" in ;; target) local -a targets - targets=3D( ${${(f)"$(_call_program targets $words[1] -sT $opt_args[(I= )(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(#b)ra= ke ([^ ]##) ##\# (*)/${${match[1]}//:/\\:}:${match[2]:l}} ) + local all + zstyle -t ":completion:${curcontext}" all-targets && all=3D-A + targets=3D( ${${(f)"$(_call_program targets $words[1] $all -sT $opt_ar= gs[(I)(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(= #b)rake ([^ ]##) ##\# (*)/${${match[1]}//:/\\:}:${match[2]:l}} ) if (( ! ${targets[(I)rake aborted!]} )) then _describe -t targets 'rake target' targets && ret=3D0 else --=20 2.29.2 --4chybzaay4qmmegp-- --azfitzhyxxtpyuft Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJMEAREIADsWIQS1pYxd0T/67YejVyF9LJoj0a6jdQUCX9ktSx0YaHR0cHM6Ly9q by1zby5kZS9wZ3Ata2V5LnR4dAAKCRB9LJoj0a6jdUzAAQC6KwLtm0PC4wonLky3 jT9+12KjvkzUEMAoBTpr66akGAD+P11ZCe3aWPS3WUomYPajN6EvnxySkOTI1dCI u5gxbcI= =ZKma -----END PGP SIGNATURE----- --azfitzhyxxtpyuft--