Change usage formatting

This commit is contained in:
Cameron Sparr authored and Nicolas Williams committed 2015-12-14 23:58:28 -06:00
1 parent 6151f20477
commit 6d76cd0a99
1 file changed
+25 -24
+25 -24
View File
@@ -49,30 +49,31 @@ static void usage(int code) {
int ret = fprintf(f, int ret = fprintf(f,
"jq - commandline JSON processor [version %s]\n" "jq - commandline JSON processor [version %s]\n"
"Usage: %s [options] <jq filter> [file...]\n\n" "\nUsage:\n\n\t%s [options] <jq filter> [file...]\n\n"
"\tjq is a tool for processing JSON inputs, applying the\n" "jq is a tool for processing JSON inputs, applying the given filter to\n"
"\tgiven filter to its JSON text inputs and producing the\n" "its JSON text inputs and producing the filter's results as JSON on\n"
"\tfilter's results as JSON on standard output.\n" "standard output.\n\n"
"\tThe simplest filter is ., which is the identity filter,\n" "The simplest filter is ., which copies jq's input to its output\n"
"\tcopying jq's input to its output unmodified (except for\n" "unmodified (except for formatting).\n\n"
"\tformatting).\n" "For more advanced filters see the jq(1) manpage (\"man jq\")\n"
"\tFor more advanced filters see the jq(1) manpage (\"man jq\")\n" "and/or https://stedolan.github.io/jq\n\n"
"\tand/or https://stedolan.github.io/jq\n\n" "Example:\n\n\t$ echo '{\"foo\": 0}' | jq .\n"
"\tSome of the options include:\n" "\t{\n\t\t\"foo\": 0\n\t}\n\n"
"\t -c\t\tcompact instead of pretty-printed output;\n" "Some of the options include:\n"
"\t -n\t\tuse `null` as the single input value;\n" " -c compact instead of pretty-printed output;\n"
"\t -e\t\tset the exit status code based on the output;\n" " -n use `null` as the single input value;\n"
"\t -s\t\tread (slurp) all inputs into an array; apply filter to it;\n" " -e set the exit status code based on the output;\n"
"\t -r\t\toutput raw strings, not JSON texts;\n" " -s read (slurp) all inputs into an array; apply filter to it;\n"
"\t -R\t\tread raw strings, not JSON texts;\n" " -r output raw strings, not JSON texts;\n"
"\t -C\t\tcolorize JSON;\n" " -R read raw strings, not JSON texts;\n"
"\t -M\t\tmonochrome (don't colorize JSON);\n" " -C colorize JSON;\n"
"\t -S\t\tsort keys of objects on output;\n" " -M monochrome (don't colorize JSON);\n"
"\t --tab\tuse tabs for indentation;\n" " -S sort keys of objects on output;\n"
"\t --arg a v\tset variable $a to value <v>;\n" " --tab use tabs for indentation;\n"
"\t --argjson a v\tset variable $a to JSON value <v>;\n" " --arg a v set variable $a to value <v>;\n"
"\t --slurpfile a f\tset variable $a to an array of JSON texts read from <f>;\n" " --argjson a v set variable $a to JSON value <v>;\n"
"\tSee the manpage for more options.\n", JQ_VERSION, progname); " --slurpfile a f set variable $a to an array of JSON texts read from <f>;\n"
"\nSee the manpage for more options.\n", JQ_VERSION, progname);
exit((ret < 0 && code == 0) ? 2 : code); exit((ret < 0 && code == 0) ? 2 : code);
} }