1
1
mirror of https://github.com/wader/fq.git synced 2024-12-25 22:34:14 +03:00
fq/pkg/interp/testdata/argvars.fqtest
2021-12-08 16:24:28 +01:00

49 lines
1.4 KiB
Plaintext

/a.json:
aaa
/b.json:
bbb
$ fq -i -n --raw-file filea /a.json --raw-file fileb /b.json --arg arga aa --arg argb bb --argjson argjsona 123 --argjson argjsonb '[true,123,{},"abc"]' --decode-file decodefilea /test.mp3 --decode-file decodefileb /test.mp3
null> $filea
"aaa\n"
null> $fileb
"bbb\n"
null> $arga
"aa"
null> $argb
"bb"
null> $argjsona
123
null> $argjsonb
[
true,
123,
{},
"abc"
]
null> $decodefileb | format
"mp3"
null> $decodefileb | format
"mp3"
null> ^D
$ fq -n --raw-file filea /nonexisting
exitcode: 2
stderr:
error: open testdata/nonexisting: no such file or directory
$ fq -n --decode-file filea /nonexisting
exitcode: 2
stderr:
error: --decode-file filea: open testdata/nonexisting: no such file or directory
$ fq -n -d mp4 --decode-file filea /test.mp3 '$filea'
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: /test.mp3 (mp4)
| | | error: mp4: error at position 0x8: no styp, ftyp, free or moov box found
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| unknown0: raw bits
* |until 0x283.7 (end) (644) | |
$ fq -n --argjson a '(' '$a'
exitcode: 2
stderr:
error: --argjson a: invalid character '(' looking for beginning of value
$ fq -n --argjson a
exitcode: 2
stderr:
error: --argjson: needs two argument