mirror of
https://github.com/wader/fq.git
synced 2024-12-25 22:34:14 +03:00
a7a101ca67
Also add authors to avro and macho decoders Generated with: for i in $(go run . -r -n '_registry | [([([.files[][].name | split(".")[0]] | unique[]), (.formats[].name)] | count[] | select(.[1] == 2)[0]), (.formats[] | select(.decode_in_arg).name)] | unique[]'); do DIR=$(dirname $(find format -name $i.go)); echo "$ fq -h $i" > "$DIR/testdata/help_$i.fqtest" ; done
113 lines
3.1 KiB
Plaintext
113 lines
3.1 KiB
Plaintext
$ fq
|
|
exitcode: 2
|
|
stderr:
|
|
Usage: fq [OPTIONS] [--] [EXPR] [FILE...]
|
|
$ fq -h
|
|
fq - jq for binary formats
|
|
Tool, language and decoders for working with binary data.
|
|
For more information see https://github.com/wader/fq
|
|
|
|
Usage: fq [OPTIONS] [--] [EXPR] [FILE...]
|
|
|
|
Example usages:
|
|
fq . file
|
|
fq d file
|
|
fq tovalue file
|
|
fq -r totoml file.yml
|
|
fq -s -d html 'map(.html.head.title?)' *.html
|
|
cat file.cbor | fq -d cbor torepr
|
|
fq 'grep("^main$") | parent' /bin/ls
|
|
fq -r 'grep_by(.protocol=="icmp").source_ip | tovalue' *.pcap
|
|
fq -i
|
|
|
|
--arg NAME VALUE Set variable $NAME to string VALUE
|
|
--argdecode NAME PATH Set variable $NAME to decode of PATH
|
|
--argjson NAME JSON Set variable $NAME to JSON
|
|
--color-output,-C Force color output
|
|
--compact-output,-c Compact output
|
|
--decode,-d NAME Decode format (probe)
|
|
--from-file,-f PATH Read EXPR from file
|
|
--help,-h [TOPIC] Show help for TOPIC (ex: --help, --help formats)
|
|
--include-path,-L PATH Include search path
|
|
--join-output,-j No newline between outputs
|
|
--monochrome-output,-M Force monochrome output
|
|
--null-input,-n Null input (use input and inputs functions to read)
|
|
--null-output,-0 Null byte between outputs
|
|
--option,-o KEY=VALUE Set option (ex: -o color=true, see --help options)
|
|
--raw-file NAME PATH Set variable $NAME to string content of file
|
|
--raw-input,-R Read raw input strings (don't decode)
|
|
--raw-output,-r Raw string output (without quotes)
|
|
--repl,-i Interactive REPL
|
|
--slurp,-s Slurp all inputs into an array or string (-Rs)
|
|
--unicode-output,-U Force unicode output
|
|
--version,-v Show version
|
|
$ fq -i
|
|
null> ^D
|
|
$ fq -i . test.mp3
|
|
mp3> ^D
|
|
$ fq -n
|
|
null
|
|
$ fq -ni
|
|
null> ^D
|
|
$ fq -n 123
|
|
123
|
|
$ fq -ni 123
|
|
number> ^D
|
|
$ fq -n "[1,2,3]"
|
|
[
|
|
1,
|
|
2,
|
|
3
|
|
]
|
|
$ fq -nc "[1,2,3]"
|
|
[1,2,3]
|
|
$ fq --help options
|
|
addrbase 16
|
|
arg []
|
|
argdecode []
|
|
argjson []
|
|
array_truncate 50
|
|
bits_format snippet
|
|
byte_colors 0-255=brightwhite,0=brightblack,32-126:9-13=white
|
|
color false
|
|
colors array=white,dumpaddr=yellow,dumpheader=yellow+underline,error=brightred,false=yellow,index=white,null=brightblack,number=cyan,object=white,objectkey=brightblue,prompt_repl_level=brightblack,prompt_value=white,string=green,true=yellow,value=white
|
|
compact false
|
|
completion_timeout 10
|
|
decode_format probe
|
|
decode_progress false
|
|
depth 0
|
|
display_bytes 16
|
|
expr .
|
|
expr_eval_path arg
|
|
expr_file
|
|
filenames [null]
|
|
force false
|
|
include_path
|
|
join_string \n
|
|
line_bytes 16
|
|
null_input false
|
|
raw_file []
|
|
raw_output false
|
|
raw_string false
|
|
repl false
|
|
show_formats false
|
|
show_help options
|
|
sizebase 10
|
|
slurp false
|
|
string_input false
|
|
unicode false
|
|
verbose false
|
|
width 135
|
|
$ fq -X
|
|
exitcode: 2
|
|
stderr:
|
|
error: -X: no such argument
|
|
$ fq --X
|
|
exitcode: 2
|
|
stderr:
|
|
error: --X: no such argument
|
|
$ fq -.
|
|
exitcode: 2
|
|
stderr:
|
|
error: -.: no such argument
|