Skip to content

Commit

Permalink
Merge pull request #1016 from wader/debug-compat
Browse files Browse the repository at this point in the history
interp: debug/* should use DEBUG: not DEBUG
  • Loading branch information
wader authored Sep 26, 2024
2 parents 8155a9c + 77da764 commit b5b9dd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/interp/internal.jq
Original file line number Diff line number Diff line change
Expand Up @@ -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, .;
Expand Down
4 changes: 2 additions & 2 deletions pkg/interp/testdata/debug.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit b5b9dd8

Please sign in to comment.