2023-02-26 23:18:36 +03:00
|
|
|
|
/filea:
|
|
|
|
|
aaa
|
2021-08-28 21:07:57 +03:00
|
|
|
|
$ fq -n options
|
|
|
|
|
{
|
|
|
|
|
"addrbase": 16,
|
2021-09-07 00:42:05 +03:00
|
|
|
|
"arg": [],
|
2022-07-04 13:24:03 +03:00
|
|
|
|
"argdecode": [],
|
2021-09-07 00:42:05 +03:00
|
|
|
|
"argjson": [],
|
2021-09-22 01:32:57 +03:00
|
|
|
|
"array_truncate": 50,
|
2022-12-01 19:35:13 +03:00
|
|
|
|
"bits_format": "string",
|
2022-03-02 03:37:18 +03:00
|
|
|
|
"byte_colors": [
|
|
|
|
|
{
|
|
|
|
|
"ranges": [
|
|
|
|
|
[
|
|
|
|
|
0,
|
|
|
|
|
255
|
|
|
|
|
]
|
|
|
|
|
],
|
2023-10-10 11:55:12 +03:00
|
|
|
|
"value": "default+bold"
|
2022-03-02 03:37:18 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"ranges": [
|
|
|
|
|
[
|
|
|
|
|
0
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
"value": "brightblack"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"ranges": [
|
|
|
|
|
[
|
|
|
|
|
32,
|
|
|
|
|
126
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
9,
|
|
|
|
|
13
|
|
|
|
|
]
|
|
|
|
|
],
|
2023-10-10 11:55:12 +03:00
|
|
|
|
"value": "default"
|
2022-03-02 03:37:18 +03:00
|
|
|
|
}
|
|
|
|
|
],
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"color": false,
|
2022-03-02 03:37:18 +03:00
|
|
|
|
"colors": {
|
2023-10-10 11:55:12 +03:00
|
|
|
|
"array": "default",
|
2022-03-02 03:37:18 +03:00
|
|
|
|
"dumpaddr": "yellow",
|
|
|
|
|
"dumpheader": "yellow+underline",
|
|
|
|
|
"error": "brightred",
|
|
|
|
|
"false": "yellow",
|
2023-10-10 11:55:12 +03:00
|
|
|
|
"index": "default",
|
2022-03-02 03:37:18 +03:00
|
|
|
|
"null": "brightblack",
|
|
|
|
|
"number": "cyan",
|
2023-10-10 11:55:12 +03:00
|
|
|
|
"object": "default",
|
2022-03-02 03:37:18 +03:00
|
|
|
|
"objectkey": "brightblue",
|
|
|
|
|
"prompt_repl_level": "brightblack",
|
2023-10-10 11:55:12 +03:00
|
|
|
|
"prompt_value": "default",
|
2022-03-02 03:37:18 +03:00
|
|
|
|
"string": "green",
|
|
|
|
|
"true": "yellow",
|
2023-10-10 11:55:12 +03:00
|
|
|
|
"value": "default"
|
2022-03-02 03:37:18 +03:00
|
|
|
|
},
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"compact": false,
|
2022-02-16 19:10:41 +03:00
|
|
|
|
"completion_timeout": 10,
|
2023-03-29 01:36:55 +03:00
|
|
|
|
"decode_group": "probe",
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"decode_progress": false,
|
|
|
|
|
"depth": 0,
|
2021-09-22 01:32:57 +03:00
|
|
|
|
"display_bytes": 16,
|
2021-09-01 20:53:12 +03:00
|
|
|
|
"expr": "options",
|
|
|
|
|
"expr_eval_path": "arg",
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"expr_file": null,
|
2022-11-29 20:26:32 +03:00
|
|
|
|
"expr_given": true,
|
2021-09-01 20:53:12 +03:00
|
|
|
|
"filenames": [
|
2021-11-30 14:23:20 +03:00
|
|
|
|
null
|
2021-09-01 20:53:12 +03:00
|
|
|
|
],
|
2022-02-05 19:16:10 +03:00
|
|
|
|
"force": false,
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"include_path": null,
|
|
|
|
|
"join_string": "\n",
|
2021-09-22 01:32:57 +03:00
|
|
|
|
"line_bytes": 16,
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"null_input": true,
|
2021-11-01 14:02:06 +03:00
|
|
|
|
"raw_file": [],
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"raw_output": false,
|
|
|
|
|
"raw_string": false,
|
|
|
|
|
"repl": false,
|
2021-09-01 20:53:12 +03:00
|
|
|
|
"show_formats": false,
|
|
|
|
|
"show_help": false,
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"sizebase": 10,
|
2023-04-02 13:20:01 +03:00
|
|
|
|
"skip_gaps": false,
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"slurp": false,
|
2021-09-01 16:01:13 +03:00
|
|
|
|
"string_input": false,
|
2021-08-28 21:07:57 +03:00
|
|
|
|
"unicode": false,
|
2022-08-19 18:46:50 +03:00
|
|
|
|
"value_output": false,
|
2022-04-16 12:22:56 +03:00
|
|
|
|
"verbose": false,
|
2022-04-19 19:19:40 +03:00
|
|
|
|
"width": 135
|
2021-08-28 21:07:57 +03:00
|
|
|
|
}
|
2021-08-26 16:38:49 +03:00
|
|
|
|
$ fq -o addrbase=10 -n options.addrbase
|
|
|
|
|
10
|
|
|
|
|
$ fq -o addrbase=true -n options.addrbase
|
|
|
|
|
16
|
2021-09-22 01:32:57 +03:00
|
|
|
|
$ fq -o array_truncate=10 -n options.array_truncate
|
2021-08-30 13:51:42 +03:00
|
|
|
|
10
|
2021-09-22 01:32:57 +03:00
|
|
|
|
$ fq -o array_truncate=true -n options.array_truncate
|
2021-08-30 13:51:42 +03:00
|
|
|
|
50
|
2021-09-22 01:32:57 +03:00
|
|
|
|
$ fq -o bits_format=base64 -n options.bits_format
|
2021-08-26 16:38:49 +03:00
|
|
|
|
"base64"
|
2021-09-22 01:32:57 +03:00
|
|
|
|
$ fq -o byte_colors=0-0xff=red -n options.byte_colors
|
2022-03-02 03:37:18 +03:00
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
"ranges": [
|
|
|
|
|
[
|
|
|
|
|
0,
|
|
|
|
|
255
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
"value": "red"
|
|
|
|
|
}
|
|
|
|
|
]
|
2021-08-26 16:38:49 +03:00
|
|
|
|
$ fq -o color=10 -n options.color
|
|
|
|
|
[33mtrue[m
|
|
|
|
|
$ fq -o color=true -n options.color
|
|
|
|
|
[33mtrue[m
|
|
|
|
|
$ fq -o colors=number=red -n options.colors
|
2022-03-02 03:37:18 +03:00
|
|
|
|
{
|
|
|
|
|
"number": "red"
|
|
|
|
|
}
|
2021-08-26 16:38:49 +03:00
|
|
|
|
$ fq -o compact=true -n options.compact
|
|
|
|
|
true
|
|
|
|
|
$ fq -o compact=aaa -n options.compact
|
|
|
|
|
false
|
2022-07-04 13:24:03 +03:00
|
|
|
|
$ fq -n -o 'argdecode=[["a", "test.mp3"]]' '$a | format'
|
2021-11-30 14:23:20 +03:00
|
|
|
|
"mp3"
|
2021-08-26 16:38:49 +03:00
|
|
|
|
$ fq -o decode_progress=false -n options.decode_progress
|
|
|
|
|
false
|
|
|
|
|
$ fq -o decode_progress=aaa -n options.decode_progress
|
|
|
|
|
false
|
|
|
|
|
$ fq -o depth=10 -n options.depth
|
|
|
|
|
10
|
|
|
|
|
$ fq -o depth=true -n options.depth
|
|
|
|
|
0
|
2021-09-22 01:32:57 +03:00
|
|
|
|
$ fq -o display_bytes=10 -n options.display_bytes
|
2021-08-26 16:38:49 +03:00
|
|
|
|
10
|
2021-09-22 01:32:57 +03:00
|
|
|
|
$ fq -o display_bytes=true -n options.display_bytes
|
2021-08-26 16:38:49 +03:00
|
|
|
|
16
|
2021-11-30 14:23:20 +03:00
|
|
|
|
$ fq -n -o expr=123
|
|
|
|
|
123
|
2021-08-26 16:38:49 +03:00
|
|
|
|
$ fq -o expr_file=test.jq -n options.expr_file
|
2021-09-01 20:53:12 +03:00
|
|
|
|
exitcode: 2
|
2021-08-26 16:38:49 +03:00
|
|
|
|
stderr:
|
2022-02-21 00:25:46 +03:00
|
|
|
|
error: test.jq: no such file or directory
|
2022-05-21 20:33:52 +03:00
|
|
|
|
$ fq -o 'filenames=["test.mp3"]' format
|
2021-11-30 14:23:20 +03:00
|
|
|
|
"mp3"
|
2022-02-05 19:16:10 +03:00
|
|
|
|
$ fq -o 'force=true' -n options.force
|
|
|
|
|
true
|
2021-08-26 16:38:49 +03:00
|
|
|
|
$ fq -o include_path=path -n options.include_path
|
|
|
|
|
"path"
|
2021-09-22 19:03:28 +03:00
|
|
|
|
$ fq -o 'join_string=aaa\n' -n options.join_string
|
2021-08-26 16:38:49 +03:00
|
|
|
|
"aaa\n"aaa
|
2021-09-22 01:32:57 +03:00
|
|
|
|
$ fq -o line_bytes=true -n options.line_bytes
|
2021-08-26 16:38:49 +03:00
|
|
|
|
16
|
|
|
|
|
$ fq -o null_input=true -n options.null_input
|
|
|
|
|
true
|
|
|
|
|
$ fq -o null_input=aaa -n options.null_input
|
|
|
|
|
true
|
|
|
|
|
$ fq -o raw_output=true -n options.raw_output
|
|
|
|
|
true
|
|
|
|
|
$ fq -o raw_output=aaa -n options.raw_output
|
|
|
|
|
false
|
|
|
|
|
$ fq -o raw_string=true -n options.raw_string
|
|
|
|
|
true
|
|
|
|
|
$ fq -o raw_string=aa -n options.raw_string
|
|
|
|
|
false
|
|
|
|
|
$ fq -o repl=true -n options.repl
|
|
|
|
|
boolean> ^D
|
|
|
|
|
$ fq -o sizebase=10 -n options.sizebase
|
|
|
|
|
10
|
|
|
|
|
$ fq -o sizebase=aaa -n options.sizebase
|
|
|
|
|
10
|
2021-09-01 19:30:26 +03:00
|
|
|
|
$ fq -o slurp=true -n options.slurp
|
2021-08-26 16:38:49 +03:00
|
|
|
|
true
|
|
|
|
|
$ fq -o slurp=aaa -n options.slurp
|
|
|
|
|
false
|
2021-09-01 19:30:26 +03:00
|
|
|
|
$ fq -o string_input=true -n options.string_input
|
|
|
|
|
true
|
|
|
|
|
$ fq -o string_input=aaa -n options.string_input
|
|
|
|
|
false
|
2021-08-26 16:38:49 +03:00
|
|
|
|
$ fq -o unicode=true -n options.unicode
|
|
|
|
|
true
|
|
|
|
|
$ fq -o unicode=aaa -n options.unicode
|
|
|
|
|
false
|
|
|
|
|
$ fq -o verbose=true -n options.verbose
|
|
|
|
|
true
|
|
|
|
|
$ fq -o verbose=aaa -n options.verbose
|
|
|
|
|
false
|
2021-09-22 19:03:28 +03:00
|
|
|
|
$ fq -n "options | {display_bytes, line_bytes}"
|
|
|
|
|
{
|
|
|
|
|
"display_bytes": 16,
|
|
|
|
|
"line_bytes": 16
|
|
|
|
|
}
|
2022-04-16 12:22:56 +03:00
|
|
|
|
$ _STDOUT_IS_TERMINAL= fq -n "options | {display_bytes, line_bytes}"
|
2021-09-22 19:03:28 +03:00
|
|
|
|
{
|
|
|
|
|
"display_bytes": 16,
|
|
|
|
|
"line_bytes": 16
|
|
|
|
|
}
|
|
|
|
|
$ _STDOUT_WIDTH=160 _STDOUT_HEIGHT=40 fq -n "options | {display_bytes, line_bytes}"
|
|
|
|
|
{
|
|
|
|
|
"display_bytes": 20,
|
|
|
|
|
"line_bytes": 20
|
|
|
|
|
}
|
2022-04-16 12:22:56 +03:00
|
|
|
|
$ _STDOUT_IS_TERMINAL= _STDOUT_WIDTH=160 _STDOUT_HEIGHT=40 fq -n "options | {display_bytes, line_bytes}"
|
2021-09-22 19:03:28 +03:00
|
|
|
|
{
|
2022-04-16 12:22:56 +03:00
|
|
|
|
"display_bytes": 20,
|
|
|
|
|
"line_bytes": 20
|
2021-09-22 19:03:28 +03:00
|
|
|
|
}
|
|
|
|
|
$ fq -in
|
|
|
|
|
null> options | {display_bytes, line_bytes}
|
|
|
|
|
{
|
|
|
|
|
"display_bytes": 16,
|
|
|
|
|
"line_bytes": 16
|
|
|
|
|
}
|
|
|
|
|
null> _STDOUT_WIDTH=160 _STDOUT_HEIGHT=40 options | {display_bytes, line_bytes}
|
|
|
|
|
{
|
|
|
|
|
"display_bytes": 20,
|
|
|
|
|
"line_bytes": 20
|
|
|
|
|
}
|
|
|
|
|
null> ^D
|
2023-02-26 23:18:36 +03:00
|
|
|
|
$ fq -n -o from_file=@filea options.from_file
|
|
|
|
|
"aaa\n"
|
|
|
|
|
$ fq -n -o from_file=@does_not_exist options.from_file
|
|
|
|
|
exitcode: 2
|
|
|
|
|
stderr:
|
|
|
|
|
error: -o from_file=@does_not_exist: no such file or directory
|