Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/jqPublic

Commit8fea16e

Browse files
committed
Improve --help to mention all the command options
1 parentc9c45d7 commit8fea16e

File tree

6 files changed

+41
-32
lines changed

6 files changed

+41
-32
lines changed

‎docs/content/manual/manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ sections:
104104
You can affect how jq reads and writes its input and output
105105
using some command-line options:
106106
107-
* `--version`:
107+
* `--version`/`-V`:
108108
109109
Output the jq version and exit with zero.
110110

‎docs/content/manual/v1.4/manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ sections:
9393
You can affect how jq reads and writes its input and output
9494
using some command-line options:
9595
96-
* `--version`:
96+
* `--version`/`-V`:
9797
9898
Output the jq version and exit with zero.
9999

‎docs/content/manual/v1.5/manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ sections:
9595
You can affect how jq reads and writes its input and output
9696
using some command-line options:
9797
98-
* `--version`:
98+
* `--version`/`-V`:
9999
100100
Output the jq version and exit with zero.
101101

‎docs/content/manual/v1.6/manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ sections:
103103
You can affect how jq reads and writes its input and output
104104
using some command-line options:
105105
106-
* `--version`:
106+
* `--version`/`-V`:
107107
108108
Output the jq version and exit with zero.
109109

‎jq.1.prebuilt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎src/main.c

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,40 +57,49 @@ static void usage(int code, int keep_it_short) {
5757
"its JSON text inputs and producing the filter's results as JSON on\n"
5858
"standard output.\n\n"
5959
"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",
6664
JQ_VERSION,progname,progname,progname);
6765
if (keep_it_short) {
6866
fprintf(f,
69-
"Foralistingof options, use %s --help.\n",
67+
"For listingthe command options, use %s --help.\n",
7068
progname);
7169
}else {
7270
(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"
91101
"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");
94103
}
95104
exit((ret<0&&code==0) ?2 :code);
96105
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp