kislyuk / yq

Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
https://kislyuk.github.io/yq/
Apache License 2.0
2.57k stars 82 forks source link

`yq -n` errors out with tty input #117

Closed pisto closed 3 years ago

pisto commented 3 years ago

A discrepancy with jq:

[pisto@kp ~]$ jq -rn '"ok"'
ok
[pisto@kp ~]$ yq -rn '"ok"' < /dev/null 
ok
[pisto@kp ~]$ echo | yq -rn '"ok"'
ok
[pisto@kp ~]$ yq -rn '"ok"'
usage: yq [options] <jq filter> [YAML file...]
[...]
kislyuk commented 3 years ago

Thanks for pointing this out. This should be fixed in https://github.com/kislyuk/yq/commit/36995e537a7373db5f325062432076002fcc587f; released in v2.12.2.