diff --git a/docs/content/manual/dev/manual.yml b/docs/content/manual/dev/manual.yml index 44fcfa08..96a7269d 100644 --- a/docs/content/manual/dev/manual.yml +++ b/docs/content/manual/dev/manual.yml @@ -241,7 +241,8 @@ sections: bind `$foo` to `"123"`. Named arguments are also available to the jq program as - `$ARGS.named`. + `$ARGS.named`. When the name is not a valid identifier, this is + the only way to access it. * `--argjson name JSON-text`: diff --git a/jq.1.prebuilt b/jq.1.prebuilt index ee3ad292..4091cd20 100644 --- a/jq.1.prebuilt +++ b/jq.1.prebuilt @@ -1,5 +1,5 @@ . -.TH "JQ" "1" "October 2024" "" "" +.TH "JQ" "1" "November 2024" "" "" . .SH "NAME" \fBjq\fR \- Command\-line JSON processor @@ -181,7 +181,7 @@ Prepend \fBdirectory\fR to the search list for modules\. If this option is used This 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\. . .IP -Named arguments are also available to the jq program as \fB$ARGS\.named\fR\. +Named 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\. . .TP \fB\-\-argjson name JSON\-text\fR: diff --git a/src/main.c b/src/main.c index ffa4f1b2..372342c9 100644 --- a/src/main.c +++ b/src/main.c @@ -454,7 +454,6 @@ int main(int argc, char* argv[]) { further_args_are_strings = 0; further_args_are_json = 1; } else if (isoption(&text, 0, "arg", is_short)) { - // FIXME: For --arg* we should check that the varname is acceptable if (i >= argc - 2) { fprintf(stderr, "%s: --arg takes two parameters (e.g. --arg varname value)\n", progname); die();