mirror of
https://github.com/wader/fq.git
synced 2024-12-28 08:02:28 +03:00
0a043f9096
Now repl, slurp and help implemented using same query rewrite. Include filename context in error if possible. Add spew function that does opposite of slurp. Start of help infra, not done or documented yet. Show error pointer on parse error. Rename internal eval to _eval and make eval be wrapper that does rewrite and has various eror handling etc. Nicer repl, slupr and help errors.
27 lines
502 B
Plaintext
27 lines
502 B
Plaintext
$ fq
|
|
exitcode: 2
|
|
stderr:
|
|
Usage: fq [OPTIONS] [--] [EXPR] [FILE...]
|
|
$ fq -n '1+"a"'
|
|
exitcode: 5
|
|
stderr:
|
|
error: cannot add: number (1) and string ("a")
|
|
$ fq -n '"abc" | halt_error(123)'
|
|
exitcode: 123
|
|
stderr:
|
|
error: abc
|
|
$ fq -n 'null | halt_error(123)'
|
|
exitcode: 123
|
|
$ fq -n invalid
|
|
exitcode: 3
|
|
stderr:
|
|
error: arg: function not defined: invalid/0
|
|
$ fq -n "("
|
|
exitcode: 3
|
|
stderr:
|
|
error: arg:1:2: unexpected token <EOF>
|
|
$ fq . non-existing
|
|
exitcode: 2
|
|
stderr:
|
|
error: non-existing: no such file or directory
|