#943558 jq crashes violently if --jsonargs is not valid JSON

Package:
jq
Source:
jq
Description:
lightweight and flexible command-line JSON processor
Submitter:
Etienne Dechamps
Date:
2019-10-26 14:03:05 UTC
Severity:
minor
#943558#5
Date:
2019-10-26 14:00:23 UTC
From:
To:
This works, because "foo" is a valid JSON value:

$ jq --null-input '$ARGS' --jsonargs '"foo"'
{
  "positional": [
    "foo"
  ],
  "named": {}
}

But if the passed-in value is not a valid JSON value, jq crashes violently:

$ jq --null-input '$ARGS' --jsonargs foo
{
  "positional": [
jq: src/jv_print.c:223: jv_dump_term: Assertion `0 && "Invalid value"' failed.
Aborted (core dumped)

jq should fail more gracefully with a proper error message when an
invalid jsonargs is passed.