Improve --help to mention all the command options
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by itchyny · committed by Nico Williams · parent 5753722 · Browse files · 6 files·+42 added−32 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+42 added−32 removed
- other:+42 added−32 removed
Provenance
- Commit
99a381b- Tree
154b5e2- Author
itchyny <itchyny@cybozu.co.jp>- Committer
Nico Williams <nico@cryptonector.com>- Parent
5753722
6 files changed+42 added−32 removed
modified:docs/content/manual/v1.4/manual.yml+1 added-1 removed
91 unmodified lines92 93 You can affect how jq reads and writes its input and output94 using some command-line options:95 96- * `--version`:96+ * `--version`/`-V`:97 98 Output the jq version and exit with zero.99 100 * `--slurp`/`-s`:1567 unmodified linesmodified:docs/content/manual/v1.5/manual.yml+1 added-1 removed
93 unmodified lines94 95 You can affect how jq reads and writes its input and output96 using some command-line options:97 98- * `--version`:98+ * `--version`/`-V`:99 100 Output the jq version and exit with zero.101 102 * `--seq`:2764 unmodified linesmodified:docs/content/manual/v1.6/manual.yml+1 added-1 removed
101 unmodified lines102 103 You can affect how jq reads and writes its input and output104 using some command-line options:105 106- * `--version`:106+ * `--version`/`-V`:107 108 Output the jq version and exit with zero.109 110 * `--seq`:3180 unmodified linesmodified:docs/content/manual/manual.yml+1 added-1 removed
102 unmodified lines103 104 You can affect how jq reads and writes its input and output105 using some command-line options:106 107- * `--version`:107+ * `--version`/`-V`:108 109 Output the jq version and exit with zero.110 111 * `--seq`:3433 unmodified linesmodified:src/main.c+37 added-27 removed
55 unmodified lines56 "jq is a tool for processing JSON inputs, applying the given filter to\n"57 "its JSON text inputs and producing the filter's results as JSON on\n"58 "standard output.\n\n"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",64 JQ_VERSION, progname, progname, progname);65 if (keep_it_short) {66 fprintf(f,69- "For a listing of options, use %s --help.\n",67+ "For listing the command options, use %s --help.\n",68 progname);69 } else {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+ " --stream-errors implies --stream and report JSON parse error with an array;\n"87+ " --unbuffered flush output stream after each output;\n"88+ " --seq parse input and output in application/json-seq MIME type scheme;\n"89+ " -f, --from-file file load filter from the file;\n"90+ " -L directory search modules from the directory;\n"91+ " --arg name value set variable $name to the string value;\n"92+ " --argjson name value set variable $name to the JSON value;\n"93+ " --slurpfile name file set variable $name to an array of JSON values read from the file;\n"94+ " --rawfile name file set variable $name to a string consisting of the contents of the file;\n"95+ " --args consume remaining arguments as positional string values;\n"96+ " --jsonargs consume remaining arguments as positional JSON values;\n"97+ " -e, --exit-status set the exit status code based on the output;\n"98+ " -b, --binary open input and output streams in binary mode on Windows;\n"99+ " -V, --version show the version;\n"100+ " -h, --help show the help;\n"101+ " -- terminates argument processing;\n\n"102 "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");103+ "positional arguments are available as $ARGS.positional[].\n");104 }105 exit((ret < 0 && code == 0) ? 2 : code);106 }107 648 unmodified linesmodified:jq.1.prebuilt+1 added-1 removed
50 unmodified lines51 .P52 You can affect how jq reads and writes its input and output using some command\-line options:53 .54 .TP55-\fB\-\-version\fR:55+\fB\-\-version\fR/\fB\-V\fR:56 .57 .IP58 Output the jq version and exit with zero\.59 .3895 unmodified lines