@@ -57,40 +57,49 @@ static void usage(int code, int keep_it_short) {
57
57
"its JSON text inputs and producing the filter's results as JSON on\n"
58
58
"standard output.\n\n"
59
59
"The simplest filter is ., which copies jq's input to its output\n"
60
- "unmodified (except for formatting, but note that IEEE754 is used\n"
61
- "for number representation internally, with all that that implies).\n\n"
62
- "For more advanced filters see the jq(1) manpage (\"man jq\")\n"
63
- "and/or https://jqlang.github.io/jq\n\n"
64
- "Example:\n\n\t$ echo '{\"foo\": 0}' | jq .\n"
65
- "\t{\n\t\t\"foo\": 0\n\t}\n\n" ,
60
+ "unmodified except for formatting. For more advanced filters see\n"
61
+ "the jq(1) manpage (\"man jq\") and/or https://jqlang.github.io/jq/.\n\n"
62
+ "Example:\n\n\t $ echo '{\"foo\": 0}' | jq .\n"
63
+ "\t{\n\t \"foo\": 0\n\t}\n\n" ,
66
64
JQ_VERSION ,progname ,progname ,progname );
67
65
if (keep_it_short ) {
68
66
fprintf (f ,
69
- "Fora listing of options, use %s --help.\n" ,
67
+ "For listing of options, use %s --help.\n" ,
70
68
progname );
71
69
}else {
72
70
(void )fprintf (f ,
73
- "Some of the options include:\n"
74
- " -c compact instead of pretty-printed output;\n"
75
- " -n use `null` as the single input value;\n"
76
- " -e set the exit status code based on the output;\n"
77
- " -s read (slurp) all inputs into an array; apply filter to it;\n"
78
- " -r output raw strings, not JSON texts;\n"
79
- " -R read raw strings, not JSON texts;\n"
80
- " -C colorize JSON;\n"
81
- " -M monochrome (don't colorize JSON);\n"
82
- " -S sort keys of objects on output;\n"
83
- " --tab use tabs for indentation;\n"
84
- " --arg a v set variable $a to value <v>;\n"
85
- " --argjson a v set variable $a to JSON value <v>;\n"
86
- " --slurpfile a f set variable $a to an array of JSON texts read from <f>;\n"
87
- " --rawfile a f set variable $a to a string consisting of the contents of <f>;\n"
88
- " --args remaining arguments are string arguments, not files;\n"
89
- " --jsonargs remaining arguments are JSON arguments, not files;\n"
90
- " -- terminates argument processing;\n\n"
71
+ "Command options:\n"
72
+ " -n, --null-input use `null` as the single input value;\n"
73
+ " -R, --raw-input read each line as strings, not parsing as JSON;\n"
74
+ " -s, --slurp read all inputs into an array and use it as the single input value;\n"
75
+ " -c, --compact-output compact instead of pretty-printed output;\n"
76
+ " -r, --raw-output output strings directly without escapes and quotes;\n"
77
+ " -j, --join-output implies -r and output without newline after each output;\n"
78
+ " -0, --nul-output implies -r and output NUL after each output;\n"
79
+ " -a, --ascii-output output strings by only ASCII characters using escape sequences;\n"
80
+ " -S, --sort-keys sort keys of each object on output;\n"
81
+ " -C, --color-output colorize JSON output;\n"
82
+ " -M, --monochrome-output disable colored output;\n"
83
+ " --tab use tabs for indentation;\n"
84
+ " --indent n use the given number of spaces (no more than 7) for indentation;\n"
85
+ " --stream parse the input value in streaming fashion;\n"
86
+ " --unbuffered flush output stream after each output;\n"
87
+ " --seq parse input and output in application/json-seq MIME type scheme;\n"
88
+ " -f, --from-file file load filter from the file;\n"
89
+ " -L directory search modules from the directory;\n"
90
+ " --arg name value set variable $name to the string value;\n"
91
+ " --argjson name value set variable $name to the JSON value;\n"
92
+ " --slurpfile name file set variable $name to an array of JSON values read from the file;\n"
93
+ " --rawfile name file set variable $name to a string consisting of the contents of the file;\n"
94
+ " --args consume remaining arguments as positional string values;\n"
95
+ " --jsonargs consume remaining arguments as positional JSON values;\n"
96
+ " -e, --exit-status set the exit status code based on the output;\n"
97
+ " -b, --binary open input and output streams in binary mode on Windows;\n"
98
+ " -V, --version show the version;\n"
99
+ " -h, --help show the help;\n"
100
+ " -- terminates argument processing;\n\n"
91
101
"Named arguments are also available as $ARGS.named[], while\n"
92
- "positional arguments are available as $ARGS.positional[].\n"
93
- "\nSee the manpage for more options.\n" );
102
+ "positional arguments are available as $ARGS.positional[].\n" );
94
103
}
95
104
exit ((ret < 0 && code == 0 ) ?2 :code );
96
105
}