diff --git a/docs/content/manual/manual.yml b/docs/content/manual/manual.yml index 242cf510e4..842c937349 100644 --- a/docs/content/manual/manual.yml +++ b/docs/content/manual/manual.yml @@ -313,9 +313,8 @@ sections: * `--`: - Terminates argument processing. Remaining arguments are - positional, either strings, JSON texts, or input filenames, - according to whether `--args` or `--jsonargs` were given. + Terminates argument processing. Remaining arguments are not + interpreted as options. * `--run-tests [filename]`: diff --git a/jq.1.prebuilt b/jq.1.prebuilt index 1f604e263f..dbdf52b7a2 100644 --- a/jq.1.prebuilt +++ b/jq.1.prebuilt @@ -250,7 +250,7 @@ Output the jq help and exit with zero\. \fB\-\-\fR: . .IP -Terminates argument processing\. Remaining arguments are positional, either strings, JSON texts, or input filenames, according to whether \fB\-\-args\fR or \fB\-\-jsonargs\fR were given\. +Terminates argument processing\. Remaining arguments are not interpreted as options\. . .TP \fB\-\-run\-tests [filename]\fR: diff --git a/src/main.c b/src/main.c index 6d857c3671..226c926ce2 100644 --- a/src/main.c +++ b/src/main.c @@ -353,8 +353,10 @@ int main(int argc, char* argv[]) { size_t short_opts = 0; jv lib_search_paths = jv_null(); for (int i=1; i /dev/null; then fi fi +# Allow passing the inline jq script before -- #2919 +if ! r=$($JQ --args -rn -- '$ARGS.positional[0]' bar) || [ "$r" != bar ]; then + echo "passing the inline script after -- didn't work" + exit 1 +fi +if ! r=$($JQ --args -rn 1 -- '$ARGS.positional[0]' bar) || [ "$r" != 1 ]; then + echo "passing the inline script before -- didn't work" + exit 1 +fi + exit 0