Skip to content
Myr

Remove outdated FIXME

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

This comment predates the addition of $ARGS in jq 1.6, so there was no way to access named arguments with an invalid identifier. Rather than forbid such names, update the manual to clarify.

authored by Thalia Archibald · committed by Emanuele Torre · parent 7cac5e8 · Browse files · 3 files+4 added−4 removed
This commit

State

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

Diff stats

3 files+4 added−4 removed

  • other:+4 added−4 removed

3 files+4 added−4 removed

modified:docs/content/manual/dev/manual.yml+2 added-1 removed
239 unmodified lines
240 `value` will be treated as a string, so `--arg foo 123` will241 bind `$foo` to `"123"`.242243 Named arguments are also available to the jq program as244 `$ARGS.named`.244 `$ARGS.named`. When the name is not a valid identifier, this is245 the only way to access it.246247 * `--argjson name JSON-text`:248249 This option passes a JSON-encoded value to the jq program as a
3574 unmodified lines
modified:src/main.c-1 removed
452 unmodified lines
453 } else if (isoption(&text, 0, "jsonargs", is_short)) {454 further_args_are_strings = 0;455 further_args_are_json = 1;456 } else if (isoption(&text, 0, "arg", is_short)) {457 // FIXME: For --arg* we should check that the varname is acceptable457 if (i >= argc - 2) {458 fprintf(stderr, "%s: --arg takes two parameters (e.g. --arg varname value)\n", progname);459 die();460 }
256 unmodified lines
modified:jq.1.prebuilt+2 added-2 removed
1.2.TH "JQ" "1" "October 2024" "" ""2.TH "JQ" "1" "November 2024" "" ""3.4.SH "NAME"5\fBjq\fR \- Command\-line JSON processor6.
173 unmodified lines
180.IP181This option passes a value to the jq program as a predefined variable\. If you run jq with \fB\-\-arg foo bar\fR, then \fB$foo\fR is available in the program and has the value \fB"bar"\fR\. Note that \fBvalue\fR will be treated as a string, so \fB\-\-arg foo 123\fR will bind \fB$foo\fR to \fB"123"\fR\.182.183.IP184Named arguments are also available to the jq program as \fB$ARGS\.named\fR\.184Named arguments are also available to the jq program as \fB$ARGS\.named\fR\. When the name is not a valid identifier, this is the only way to access it\.185.186.TP187\fB\-\-argjson name JSON\-text\fR:188.
4075 unmodified lines