From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] _jq: New completion.
Date: Mon, 09 Oct 2017 13:35:52 +0000 [thread overview]
Message-ID: <1507556152.3302151.1132636952.4C5D7BFF@webmail.messagingengine.com> (raw)
In-Reply-To: <17852.1507542820@thecus.kiddle.eu>
Oliver Kiddle wrote on Mon, 09 Oct 2017 11:53 +0200:
> Daniel Shahaf wrote:
> > I'll add a specification for positional arguments:
> >
> > "1:filter" "*:input files:_files"
>
> For the filter, it'll need to use _guard otherwise it'll block
> completion of options where an unambiguous option prefix has been
> specified.
Good catch. Interdiff:
diff --git a/Completion/Unix/Command/_jq b/Completion/Unix/Command/_jq
index 24eb4cf52..55bb93c04 100644
--- a/Completion/Unix/Command/_jq
+++ b/Completion/Unix/Command/_jq
@@ -29,4 +29,6 @@ _arguments -S -s : \
'(-e --exit-status)'{-e,--exit-status}'[report "false" and "null" results via exit code]' \
'*--arg[pre-set a variable to a string]: :_guard "|[A-Za-z][A-Za-z0-9]#" "variable name":value (string): ' \
'*--argjson[pre-set a variable to an object]: :_guard "|[A-Za-z][A-Za-z0-9]#" "variable name":value (JSON): ' \
- '*--slurpfile[pre-set a variable to contents of a file]: :_guard "|[A-Za-z][A-Za-z0-9]#" "variable name":value (filename of file containing JSON):_files'
+ '*--slurpfile[pre-set a variable to contents of a file]: :_guard "|[A-Za-z][A-Za-z0-9]#" "variable name":value (filename of file containing JSON):_files' \
+ "1: :_guard '|[^-]' filter" \
+ "*:_files"
prev parent reply other threads:[~2017-10-09 13:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 0:17 Daniel Shahaf
2017-10-09 0:23 ` Daniel Shahaf
2017-10-09 9:53 ` Oliver Kiddle
2017-10-09 13:35 ` Daniel Shahaf [this message]
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=1507556152.3302151.1132636952.4C5D7BFF@webmail.messagingengine.com \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@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).