Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _jq: New completion.
- X-seq: zsh-workers 41838
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] _jq: New completion.
- Date: Mon, 09 Oct 2017 13:35:52 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=j+lfkN 8A62fUQMrNPk23DJ7htk+BZ3PIGJfqsLnj2QA=; b=cQ2/y5nnZ1gV+wAaJs6iB2 LSX8Pvjhk9h4i9YrezVMlOtZIlbJft21ZH5EgRJDq+YuX1XLogYGqzcu8HgpBK0T 17wbKXIXFsnQ+vOBigcuI7EgagnHnaqmSAV0ldwdHoOqg4UE+QiuT37yY5jyNSfV D5WTUw2I+DUrNdl421aJy/EXLGjU3UDI8u7Lg1qHcIYrzMImyGDTIy2NSFLNp66n Y/V9+iOewulzpHg8RiWSH8f7LsQmyspLSp6DHRyiFnSK5j9WBv1isvqfqDQTrHZv 5fvuGIKAhMHGm/zRWU5+AePvEERVPbrs9gTCXE9UGmR9EWrI61QgqWWiTYNiUQUg ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=j+lfkN 8A62fUQMrNPk23DJ7htk+BZ3PIGJfqsLnj2QA=; b=dBgqDdV1Jz0ADvlj+Nx9Co XUbvqvWW5jF6xVyTHimxXK4wvTV5MA2UsbIpX7F8ZxfK02r4ROuu7sxDmG1Ht/s1 tebqvWVA06edmRMX1zE8G2l2Ka4820Mbh+eMNl56oGNr5tHwqBjPPA0y9zyPJbCx Wm8ck4aefyTrH40zoA0rAjqN93feeuf1gTHiJ3PD+0nNxkm/Wf99qvAOMaVfDI+F Zyrr9YarWhyBiRGlaJkp6OrbcriChdH3o9yQMPPtLOL7scVmGLG5aQwDxB0xAnI0 ZWiT5/9dN3dNnYT7JRpIUfafsZ639HsB5n4BJcdQ8HXUK6N+E5xT1RHjhepz8XqA ==
- In-reply-to: <17852.1507542820@thecus.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20171009001731.21365-1-danielsh@tarpaulin.shahaf.local2> <1507508635.3081469.1132035680.182E0F25@webmail.messagingengine.com> <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"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author