1
1
mirror of https://github.com/wader/fq.git synced 2024-12-23 13:22:58 +03:00

cli: Fix error filename on script error

This commit is contained in:
Mattias Wadman 2021-09-02 01:34:12 +02:00
parent ac8cfca500
commit 10d7ed7806
3 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,7 @@ For more information see https://github.com/wader/fq
Usage: fq [OPTIONS] [--] [EXPR] [FILE...] Usage: fq [OPTIONS] [--] [EXPR] [FILE...]
--compact,-c Compact output --compact,-c Compact output
--decode,-d NAME Decode format (default probe) --decode,-d NAME Decode format (probe)
--file,-f PATH Read EXPR from file --file,-f PATH Read EXPR from file
--formats Show supported formats --formats Show supported formats
--help,-h Show help --help,-h Show help

View File

@ -581,6 +581,7 @@ def _main:
end end
) )
), ),
expr_eval_path: $args_opts.expr_file,
filenames: ( filenames: (
( if $args_opts.expr_file then $rest ( if $args_opts.expr_file then $rest
else $rest[1:] else $rest[1:]

View File

@ -2,6 +2,8 @@
123 123
/test2.jq: /test2.jq:
.headers[0].magic | tovalue .headers[0].magic | tovalue
/err.jq:
asdad)
/test.mp3: /test.mp3:
$ fq -n -f /test.jq $ fq -n -f /test.jq
123 123
@ -9,3 +11,7 @@ $ fq -n -f /test.jq
123 123
$ fq -f /test2.jq /test.mp3 $ fq -f /test2.jq /test.mp3
"ID3" "ID3"
$ fq -nf /err.jq
exitcode: 3
stderr:
error: /err.jq:1:6: unexpected token ")"