File: args.fqtest

package info (click to toggle)
fq 0.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 106,624 kB
  • sloc: xml: 2,835; makefile: 250; sh: 241; exp: 57; ansic: 21
file content (128 lines) | stat: -rw-r--r-- 3,564 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
$ fq
exitcode: 2
stderr:
Usage: fq [OPTIONS] [--] [EXPR] [FILE...]
$ _STDIN_IS_TERMINAL=1 fq type
"number"
stdin:
123
$ 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 -V '.path[1].value' file
  fq tovalue file
  fq -r to_toml 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 -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 or group (probe)
--from-file,-f PATH          Read EXPR from file
--help,-h [TOPIC]            Show help for TOPIC (ex: -h formats, -h mp4)
--include-path,-L PATH       Include search path
--join-output,-j             No newline after each output
--monochrome-output,-M       Force monochrome output
--null-input,-n              Null input (use input and inputs functions to read)
--option,-o KEY=VALUE/@PATH  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)
--raw-output0                NUL (zero) byte after each output
--repl,-i                    Interactive REPL
--slurp,-s                   Slurp all inputs into an array or string (-Rs)
--unicode-output,-U          Force unicode output
--value-output,-V            Output JSON value (-Vr for raw string)
--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         string
byte_colors         0-255=default+bold,0=brightblack,32-126:9-13=default
color               false
colors              array=default,dumpaddr=yellow,dumpheader=yellow+underline,error=brightred,false=yellow,index=default,null=brightblack,number=cyan,object=default,objectkey=brightblue,prompt_repl_level=brightblack,prompt_value=default,string=green,true=yellow,value=default
compact             false
completion_timeout  10
decode_group        probe
decode_progress     false
depth               0
display_bytes       16
expr                .
expr_eval_path      arg
expr_file           
expr_given          false
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
skip_gaps           false
slurp               false
string_input        false
unicode             false
value_output        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
$ fq -0
0
stdin:
"abc"
$ fq -123
-123
stdin:
"abc"