From 5300336e77141ccf8a94e5cd173f2b02cec47aed Mon Sep 17 00:00:00 2001 From: gkze Date: Sun, 18 Jan 2015 17:38:41 -0800 Subject: [PATCH 1/4] Add --sort-keys/-S support to _jq --- src/_jq | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/_jq b/src/_jq index b9af714..1869cc6 100644 --- a/src/_jq +++ b/src/_jq @@ -40,16 +40,17 @@ declare -a opts args args=( - '(-h --help)'{-h,--help}'[display help information]' - '(-V --version)'{-V,--version}'[display version information]' - '(-s --slurp)'{-s,--slurp}'[run the filter just once]' - '(-R --raw-input)'{-R,--raw-input}'[parse the input as not JSON but string]' - '(-n --null-input)'{-n,--null-input}'[run the filter using null as the input]' - '(-c --compact-output)'{-c,--compact-output}'[compact output]' \ '(-C --color-output)'{-C,--color-output}'[colorize the output even if writing to a pipe or a file]' '(-M --monochrome-output)'{-M,--monochrome-output}'[not colorize the output]' + '(-R --raw-input)'{-R,--raw-input}'[parse the input as not JSON but string]' + '(-S --sort-keys)'{-S, --sort-keys}'[Output the fields of each object with the keys in sorted order.'] + '(-V --version)'{-V,--version}'[display version information]' '(-a --ascii-output)'{-a,--ascii-output}'[output with pure ASCII character]' + '(-c --compact-output)'{-c,--compact-output}'[compact output]' \ + '(-h --help)'{-h,--help}'[display help information]' + '(-n --null-input)'{-n,--null-input}'[run the filter using null as the input]' '(-r --raw-output)'{-r,--raw-output}'[not format string result as a JSON string with quotes]' + '(-s --slurp)'{-s,--slurp}'[run the filter just once]' '--arg[passes a value to the jq program, e.g. --arg foo bar]:jq variable: ' '1: :_guard "^-*" pattern' '*:files:->file' From 36a54e16e1c2175d0f8405e2af11a135233dc4be Mon Sep 17 00:00:00 2001 From: gkze Date: Wed, 28 Jan 2015 20:18:14 -0800 Subject: [PATCH 2/4] Ading new options from the 1.4 release --- src/_jq | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/_jq b/src/_jq index 1869cc6..5d31024 100644 --- a/src/_jq +++ b/src/_jq @@ -40,18 +40,22 @@ declare -a opts args args=( - '(-C --color-output)'{-C,--color-output}'[colorize the output even if writing to a pipe or a file]' - '(-M --monochrome-output)'{-M,--monochrome-output}'[not colorize the output]' - '(-R --raw-input)'{-R,--raw-input}'[parse the input as not JSON but string]' - '(-S --sort-keys)'{-S, --sort-keys}'[Output the fields of each object with the keys in sorted order.'] - '(-V --version)'{-V,--version}'[display version information]' - '(-a --ascii-output)'{-a,--ascii-output}'[output with pure ASCII character]' - '(-c --compact-output)'{-c,--compact-output}'[compact output]' \ - '(-h --help)'{-h,--help}'[display help information]' - '(-n --null-input)'{-n,--null-input}'[run the filter using null as the input]' - '(-r --raw-output)'{-r,--raw-output}'[not format string result as a JSON string with quotes]' - '(-s --slurp)'{-s,--slurp}'[run the filter just once]' - '--arg[passes a value to the jq program, e.g. --arg foo bar]:jq variable: ' + '(--argfile)'{--argfile}'[This option passes the first value from the named file as a value to the jq program as a predefined variable]' + '(--unbuffered)'{--unbuffered}'[Flush the output after each JSON object is printed]' + '(-C --color-output)'{-C,--color-output}'[Colorize the output even if writing to a pipe or a file]' + '(-I --online-input)'{-I,--online-input}'[When the top-level input value is an array produce its elements instead of the array]' + '(-M --monochrome-output)'{-M,--monochrome-output}'[Not colorize the output]' + '(-R --raw-input)'{-R,--raw-input}'[Parse the input as not JSON but string]' + '(-S --sort-keys)'{-S, --sort-keys}'[Output the fields of each object with the keys in sorted order]' + '(-V --version)'{-V,--version}'[Display version information]' + '(-a --ascii-output)'{-a,--ascii-output}'[Output with pure ASCII characters]' + '(-e --exit-status)'{-e,--exit-status}'[Sets the exitstatus of jq to 0 if the last output values was neither false nor null, 1 if the last output value was either false or null, or 4 if no valid result was ever produced]' + '(-c --compact-output)'{-c,--compact-output}'[Compact output]' + '(-h --help)'{-h,--help}'[Display help information]' + '(-n --null-input)'{-n,--null-input}'[Run the filter using null as the input]' + '(-r --raw-output)'{-r,--raw-output}'[Not format string result as a JSON string with quotes]' + '(-s --slurp)'{-s,--slurp}'[Run the filter just once]' + '--arg[Passes a value to the jq program, e.g. --arg foo bar]:jq variable: ' '1: :_guard "^-*" pattern' '*:files:->file' ) From dfa1f7c6aa68cbb6c98b30a088dea478a1c8e432 Mon Sep 17 00:00:00 2001 From: gkze Date: Wed, 28 Jan 2015 20:54:25 -0800 Subject: [PATCH 3/4] Corrections --- src/_jq | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_jq b/src/_jq index 5d31024..5d87b87 100644 --- a/src/_jq +++ b/src/_jq @@ -40,13 +40,13 @@ declare -a opts args args=( - '(--argfile)'{--argfile}'[This option passes the first value from the named file as a value to the jq program as a predefined variable]' - '(--unbuffered)'{--unbuffered}'[Flush the output after each JSON object is printed]' + '--argfile[This option passes the first value from the named file as a value to the jq program as a predefined variable]' + '--unbuffered)[Flush the output after each JSON object is printed]' '(-C --color-output)'{-C,--color-output}'[Colorize the output even if writing to a pipe or a file]' '(-I --online-input)'{-I,--online-input}'[When the top-level input value is an array produce its elements instead of the array]' '(-M --monochrome-output)'{-M,--monochrome-output}'[Not colorize the output]' '(-R --raw-input)'{-R,--raw-input}'[Parse the input as not JSON but string]' - '(-S --sort-keys)'{-S, --sort-keys}'[Output the fields of each object with the keys in sorted order]' + '(-S --sort-keys)'{-S,--sort-keys}'[Output the fields of each object with the keys in sorted order]' '(-V --version)'{-V,--version}'[Display version information]' '(-a --ascii-output)'{-a,--ascii-output}'[Output with pure ASCII characters]' '(-e --exit-status)'{-e,--exit-status}'[Sets the exitstatus of jq to 0 if the last output values was neither false nor null, 1 if the last output value was either false or null, or 4 if no valid result was ever produced]' From dd23e319ee2e1ef6e2482e118fb756bdd3094f69 Mon Sep 17 00:00:00 2001 From: gkze Date: Wed, 28 Jan 2015 21:59:42 -0800 Subject: [PATCH 4/4] Typo --- src/_jq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_jq b/src/_jq index 5d87b87..79f7e1c 100644 --- a/src/_jq +++ b/src/_jq @@ -41,7 +41,7 @@ declare -a opts args args=( '--argfile[This option passes the first value from the named file as a value to the jq program as a predefined variable]' - '--unbuffered)[Flush the output after each JSON object is printed]' + '--unbuffered[Flush the output after each JSON object is printed]' '(-C --color-output)'{-C,--color-output}'[Colorize the output even if writing to a pipe or a file]' '(-I --online-input)'{-I,--online-input}'[When the top-level input value is an array produce its elements instead of the array]' '(-M --monochrome-output)'{-M,--monochrome-output}'[Not colorize the output]'