mirror of
https://github.com/stedolan/jq.git
synced 2024-05-11 05:55:39 +00:00
@@ -114,6 +114,10 @@ sections:
|
|||||||
ASCII output with every non-ASCII character replaced with the
|
ASCII output with every non-ASCII character replaced with the
|
||||||
equivalent escape sequence.
|
equivalent escape sequence.
|
||||||
|
|
||||||
|
* `--sort-keys` / `-S`:
|
||||||
|
|
||||||
|
Output the fields of each object with the keys in sorted order.
|
||||||
|
|
||||||
* `--raw-output` / `-r`:
|
* `--raw-output` / `-r`:
|
||||||
|
|
||||||
With this option, if the filter's result is a string then it
|
With this option, if the filter's result is a string then it
|
||||||
|
6
main.c
6
main.c
@@ -56,8 +56,9 @@ enum {
|
|||||||
ASCII_OUTPUT = 32,
|
ASCII_OUTPUT = 32,
|
||||||
COLOUR_OUTPUT = 64,
|
COLOUR_OUTPUT = 64,
|
||||||
NO_COLOUR_OUTPUT = 128,
|
NO_COLOUR_OUTPUT = 128,
|
||||||
|
SORTED_OUTPUT = 256,
|
||||||
|
|
||||||
FROM_FILE = 256,
|
FROM_FILE = 512,
|
||||||
|
|
||||||
/* debugging only */
|
/* debugging only */
|
||||||
DUMP_DISASM = 2048,
|
DUMP_DISASM = 2048,
|
||||||
@@ -82,6 +83,7 @@ static void process(jv value, int flags) {
|
|||||||
#else
|
#else
|
||||||
dumpopts = isatty(fileno(stdout)) ? JV_PRINT_COLOUR : 0;
|
dumpopts = isatty(fileno(stdout)) ? JV_PRINT_COLOUR : 0;
|
||||||
#endif
|
#endif
|
||||||
|
if (options & SORTED_OUTPUT) dumpopts |= JV_PRINT_SORTED;
|
||||||
if (!(options & COMPACT_OUTPUT)) dumpopts |= JV_PRINT_PRETTY;
|
if (!(options & COMPACT_OUTPUT)) dumpopts |= JV_PRINT_PRETTY;
|
||||||
if (options & ASCII_OUTPUT) dumpopts |= JV_PRINT_ASCII;
|
if (options & ASCII_OUTPUT) dumpopts |= JV_PRINT_ASCII;
|
||||||
if (options & COLOUR_OUTPUT) dumpopts |= JV_PRINT_COLOUR;
|
if (options & COLOUR_OUTPUT) dumpopts |= JV_PRINT_COLOUR;
|
||||||
@@ -197,6 +199,8 @@ int main(int argc, char* argv[]) {
|
|||||||
options |= NO_COLOUR_OUTPUT;
|
options |= NO_COLOUR_OUTPUT;
|
||||||
} else if (isoption(argv[i], 'a', "ascii-output")) {
|
} else if (isoption(argv[i], 'a', "ascii-output")) {
|
||||||
options |= ASCII_OUTPUT;
|
options |= ASCII_OUTPUT;
|
||||||
|
} else if (isoption(argv[i], 'S', "sort-keys")) {
|
||||||
|
options |= SORTED_OUTPUT;
|
||||||
} else if (isoption(argv[i], 'R', "raw-input")) {
|
} else if (isoption(argv[i], 'R', "raw-input")) {
|
||||||
options |= RAW_INPUT;
|
options |= RAW_INPUT;
|
||||||
} else if (isoption(argv[i], 'n', "null-input")) {
|
} else if (isoption(argv[i], 'n', "null-input")) {
|
||||||
|
Reference in New Issue
Block a user