summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2017-10-09 00:16:42 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2017-10-13 17:51:29 +0000
commit7c36add497883137a9691b994d34e0385b0eab8f (patch)
treea16f883b44f7a6faab8f9076af9b186fdc5cc7f6 /Completion/Unix
parentb3fa5c528c79b27986a77c92a48b7f70e7f9e7d3 (diff)
downloadzsh-7c36add497883137a9691b994d34e0385b0eab8f.tar.gz
zsh-7c36add497883137a9691b994d34e0385b0eab8f.tar.xz
zsh-7c36add497883137a9691b994d34e0385b0eab8f.zip
41833 + 41838: _jq: New completion.
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_jq34
1 files changed, 34 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_jq b/Completion/Unix/Command/_jq
new file mode 100644
index 000000000..55bb93c04
--- /dev/null
+++ b/Completion/Unix/Command/_jq
@@ -0,0 +1,34 @@
+#compdef jq
+
+# last updated for jq-1.5-1-a5b5cbe (debian package 1.5+dfsg-1.3)
+
+# Note:
+#   Arguments to options must be in separate words.  Thus,
+#     {-f,--from-file}'[foo]'
+#   is correct like that, without the usual {-f+,--from-file=} suffixes.
+#
+_arguments -S -s : \
+  "--version[output jq's version number]" \
+  "--seq[use application/json-seq ASCII RS/LF scheme in input and output]" \
+  "--stream[parse input streamily (changes output)]" \
+  '(-s --slurp)'{-s,--slurp}'[join input JSON objects to array before filtering]' \
+  '(-R --raw-input)'{-R,--raw-input}'[consider each input line as a JSON strings]' \
+  '(-n --null-input)'{-n,--null-input}'[input is ignored]' \
+  '(-c --compact-output)'{-c,--compact-output}"[don't pretty-print]" \
+  '(--indent)--tab[indent output using TAB characters]' \
+  '(--tab)--indent[indent output using given number of spaces]:number of spaces (integer):(2 4 8)' \
+  '(-C --color-output -M --monochrome-output)'{-C,--color-output}'[output in color]' \
+  '(-C --color-output -M --monochrome-output)'{-M,--monochrome-output}'[output without color]' \
+  '(-a --ascii-output)'{-a,--ascii-output}'[restrict output to ASCII]' \
+  '--unbuffered[flush output after each JSON object]' \
+  '(-S --sort-keys)'{-S,--sort-keys}'[output object keys in sorted order]' \
+  '(-r --raw-output -j --join-output)'{-r,--raw-output}"[don't JSON-quote output if it's a string]" \
+  '(-r --raw-output -j --join-output)'{-j,--join-output}"[like -r, without newlines between outputs]" \
+  '(-f --from-file)'{-f,--from-file}'[read filter from file]:_files' \
+  '-L+[prepend a directory to the module search path]:_directories' \
+  '(-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' \
+  "1: :_guard '|[^-]' filter" \
+  "*:_files"