Blacksmoke16 / oq

A performant, and portable jq wrapper to facilitate the consumption and output of formats other than JSON; using jq filters to transform the data.
https://blacksmoke16.github.io/oq/
MIT License
190 stars 15 forks source link

Unable to pipe into pager #128

Open Dialga opened 3 months ago

Dialga commented 3 months ago

$ oq doc.json and the json document is pretty printed to the terminal, but $ oq q.json | less returns

jq: error: q/0 is not defined at <top-level>, line 1:
q.json
jq: 1 compile error
Blacksmoke16 commented 3 months ago

Workaround for now would be to ensure you provide a filter:

$ oq '.' doc.json | less
{
  "foo": "bar"
}

Seemingly would make sense to make the default filter '.', but I'll have to think/play around with how to best implement that.