From: "Jörg Sommer" <joerg@jo-so.de>
To: Oliver Kiddle <opk@zsh.org>
Cc: zsh-users@zsh.org
Subject: Re: How to get all tagets for rake completion?
Date: Mon, 12 Apr 2021 10:07:42 +0200 [thread overview]
Message-ID: <20210412080742.rxx5gofqhphtuehn@jo-so.de> (raw)
In-Reply-To: <54621-1617918703.747482@gwX8.ONTM.cKuV>
[-- Attachment #1.1: Type: text/plain, Size: 1140 bytes --]
Oliver Kiddle schrieb am Do 08. Apr, 23:51 (+0200):
> On 4 Apr, Jörg Sommer wrote:
> > > The existing `verbose` style is usually used to conditionally add
> > > descriptions to matches, especially where generating those descriptions
> > > is slow or where they're of questionable value.
> >
> > And how about ‘expanded’ or ‘extended’?
>
> Either of those are fine. Though you've not commented on the approach of
> inverting the sense of the style and using ignore-<something> which I
> think I prefer but I don't know rake so well.
I think rake is like make and I guess they show the uncommended tasks only
with `-A` for the same reason as make can have many internal targets they
aren't of any external use. I would choose the approach of enabling the
additional output which matches the behaviour of rake.
> Just pick whatever you think is best and update the patch with that and
> it should then be good to commit.
So here it is.
Regards Jörg
--
„Gesundheit ist dasjenige Maß an Krankheit, das es mir noch erlaubt,
meinen wesentlichen Beschäftigungen nachzugehen.“ (Friedrich Nietzsche)
[-- Attachment #1.2: 0001-Completion-_rake-add-zsytle-for-targets-without-desc.patch --]
[-- Type: text/x-diff, Size: 1543 bytes --]
From 6ba3068957f3ba555f6290f31abd07ada36cd237 Mon Sep 17 00:00:00 2001
Message-Id: <6ba3068957f3ba555f6290f31abd07ada36cd237.1618214528.git.joerg@jo-so.de>
From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg@jo-so.de>
Date: Tue, 15 Dec 2020 22:32:46 +0100
Subject: [PATCH] Completion/_rake: add zsytle for targets without description
`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:targets extended 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..10d621991 100644
--- a/Completion/Unix/Command/_rake
+++ b/Completion/Unix/Command/_rake
@@ -37,7 +37,9 @@ case "$state" in
;;
target)
local -a targets
- targets=( ${${(f)"$(_call_program targets $words[1] -sT $opt_args[(I)(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(#b)rake ([^ ]##) ##\# (*)/${${match[1]}//:/\\:}:${match[2]:l}} )
+ local all
+ zstyle -t ":completion:${curcontext}:targets" extended && all=-A
+ targets=( ${${(f)"$(_call_program targets $words[1] $all -sT $opt_args[(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=0
else
--
2.31.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 269 bytes --]
next prev parent reply other threads:[~2021-04-12 8:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 12:57 Jörg Sommer
2020-12-15 17:12 ` Peter Stephenson
2020-12-15 21:40 ` Jörg Sommer
2021-03-31 0:10 ` Oliver Kiddle
2021-03-31 7:45 ` Jörg Sommer
2021-03-31 9:50 ` Oliver Kiddle
2021-04-04 8:28 ` Jörg Sommer
2021-04-08 21:51 ` Oliver Kiddle
2021-04-12 8:07 ` Jörg Sommer [this message]
2021-04-25 16:34 ` Lawrence Velázquez
2021-05-02 16:52 ` Lawrence Velázquez
2021-05-09 17:32 ` Lawrence Velázquez
2021-05-10 12:14 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210412080742.rxx5gofqhphtuehn@jo-so.de \
--to=joerg@jo-so.de \
--cc=opk@zsh.org \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).