Skip to content
Myr

Change usage formatting

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cameron Sparr · committed by Nicolas Williams · parent 6151f20 · Browse files · 1 file+25 added−24 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+25 added−24 removed

  • other:+25 added−24 removed

1 file+25 added−24 removed

modified:src/main.c+25 added-24 removed
47 unmodified lines
48 f = stdout;4950 int ret = fprintf(f,51 "jq - commandline JSON processor [version %s]\n"52 "Usage: %s [options] <jq filter> [file...]\n\n"53 "\tjq is a tool for processing JSON inputs, applying the\n"54 "\tgiven filter to its JSON text inputs and producing the\n"55 "\tfilter's results as JSON on standard output.\n"56 "\tThe simplest filter is ., which is the identity filter,\n"57 "\tcopying jq's input to its output unmodified (except for\n"58 "\tformatting).\n"59 "\tFor more advanced filters see the jq(1) manpage (\"man jq\")\n"60 "\tand/or https://stedolan.github.io/jq\n\n"61 "\tSome of the options include:\n"62 "\t -c\t\tcompact instead of pretty-printed output;\n"63 "\t -n\t\tuse `null` as the single input value;\n"64 "\t -e\t\tset the exit status code based on the output;\n"65 "\t -s\t\tread (slurp) all inputs into an array; apply filter to it;\n"66 "\t -r\t\toutput raw strings, not JSON texts;\n"67 "\t -R\t\tread raw strings, not JSON texts;\n"68 "\t -C\t\tcolorize JSON;\n"69 "\t -M\t\tmonochrome (don't colorize JSON);\n"70 "\t -S\t\tsort keys of objects on output;\n"71 "\t --tab\tuse tabs for indentation;\n"72 "\t --arg a v\tset variable $a to value <v>;\n"73 "\t --argjson a v\tset variable $a to JSON value <v>;\n"74 "\t --slurpfile a f\tset variable $a to an array of JSON texts read from <f>;\n"75 "\tSee the manpage for more options.\n", JQ_VERSION, progname);52 "\nUsage:\n\n\t%s [options] <jq filter> [file...]\n\n"53 "jq is a tool for processing JSON inputs, applying the given filter to\n"54 "its JSON text inputs and producing the filter's results as JSON on\n"55 "standard output.\n\n"56 "The simplest filter is ., which copies jq's input to its output\n"57 "unmodified (except for formatting).\n\n"58 "For more advanced filters see the jq(1) manpage (\"man jq\")\n"59 "and/or https://stedolan.github.io/jq\n\n"60 "Example:\n\n\t$ echo '{\"foo\": 0}' | jq .\n"61 "\t{\n\t\t\"foo\": 0\n\t}\n\n"62 "Some of the options include:\n"63 " -c compact instead of pretty-printed output;\n"64 " -n use `null` as the single input value;\n"65 " -e set the exit status code based on the output;\n"66 " -s read (slurp) all inputs into an array; apply filter to it;\n"67 " -r output raw strings, not JSON texts;\n"68 " -R read raw strings, not JSON texts;\n"69 " -C colorize JSON;\n"70 " -M monochrome (don't colorize JSON);\n"71 " -S sort keys of objects on output;\n"72 " --tab use tabs for indentation;\n"73 " --arg a v set variable $a to value <v>;\n"74 " --argjson a v set variable $a to JSON value <v>;\n"75 " --slurpfile a f set variable $a to an array of JSON texts read from <f>;\n"76 "\nSee the manpage for more options.\n", JQ_VERSION, progname);77 exit((ret < 0 && code == 0) ? 2 : code);78}7980static void die() {
492 unmodified lines