1
1
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:
Mattias Wadman 2024-09-26 12:00:35 +02:00
parent 8155a9cd27
commit 77da7647ac
2 changed files with 3 additions and 3 deletions

View File

@ -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, .;

View File

@ -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}