mirror of
https://github.com/wader/fq.git
synced 2024-11-21 23:04:07 +03:00
interp: debug/* should use DEBUG: not DEBUG
This commit is contained in:
parent
8155a9cd27
commit
77da7647ac
@ -26,7 +26,7 @@ def printerr: tostring | _stderr;
|
||||
def printerrln: ., "\n" | printerr;
|
||||
|
||||
# jq compat
|
||||
def debug: (["DEBUG", .] | tojson | printerrln), .;
|
||||
def debug: (["DEBUG:", .] | tojson | printerrln), .;
|
||||
def debug(f): (f | debug | empty), .;
|
||||
# output raw string or compact json to stderr and let input thru
|
||||
def stderr: printerr, .;
|
||||
|
4
pkg/interp/testdata/debug.fqtest
vendored
4
pkg/interp/testdata/debug.fqtest
vendored
@ -11,8 +11,8 @@ null> {a: 123, b: []} | debug({a})
|
||||
}
|
||||
null> ^D
|
||||
stderr:
|
||||
["DEBUG",{"a":123,"b":[]}]
|
||||
["DEBUG",{"a":123}]
|
||||
["DEBUG:",{"a":123,"b":[]}]
|
||||
["DEBUG:",{"a":123}]
|
||||
$ fq -n 'null, {a:1}, "abc" | ., "\n" | print'
|
||||
null
|
||||
{"a":1}
|
||||
|
Loading…
Reference in New Issue
Block a user