mirror of
https://github.com/wader/fq.git
synced 2024-12-26 15:02:28 +03:00
e238f292af
Rewrite non-sub-repl queries as "q" -> ".[] | q" and pass in inputs as array. Before each input did an eval. Also fixup error message a bit, skip line:column when they dont make sense.
27 lines
617 B
Plaintext
27 lines
617 B
Plaintext
/library/a.jq:
|
|
def a: "a";
|
|
/config/has_error.jq:
|
|
)
|
|
$ fq -L /library -n 'include "a"; a'
|
|
"a"
|
|
$ fq --include-path /library -n 'include "a"; a'
|
|
"a"
|
|
$ fq -L /wrong -L /library -n 'include "a"; a'
|
|
"a"
|
|
$ fq -n 'include "/library/a"; a'
|
|
"a"
|
|
$ fq -L /wrong -n 'include "a"; a'
|
|
exitcode: 3
|
|
stderr:
|
|
error: arg: open a.jq: file does not exist
|
|
$ fq -n 'include "@config/a";'
|
|
exitcode: 3
|
|
stderr:
|
|
error: arg: open testdata/config/a.jq: no such file or directory
|
|
$ fq -n 'include "@config/missing?";'
|
|
null
|
|
$ fq -n 'include "@config/has_error?";'
|
|
exitcode: 3
|
|
stderr:
|
|
error: arg: /config/has_error.jq:1:1: parse: unexpected token ")"
|