1
0
mirror of https://github.com/jqlang/jq.git synced 2025-08-06 22:02:40 +03:00

Allow passing the inline jq script before --

jq previously only allowed passing the inline script before -- (as if
they were options) even though one would expect the inline script to be
a positional argument.

Since jq previously also refused to run with a usage error if the script
was passed after -- (It was not assuming  .  as script as it does when
no arguments are passed), and positional arguments are allowed before --
and even before other options, it should not be a breaking change to
change that weird behaviour, and allow the script to appear after --.

It also simplifies the option parsing code a bunch.

Fixes #2918
This commit is contained in:
Emanuele Torre
2023-10-03 04:39:42 +02:00
committed by Nico Williams
parent 7f547827e4
commit 4ebd21e1eb
4 changed files with 17 additions and 25 deletions

View File

@@ -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]`: