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

[2.11.0 regression] The CLI explodes with jq help output on stdin #103

Closed webknjaz closed 3 years ago

webknjaz commented 3 years ago

2.10 works: https://travis-ci.com/github/aio-libs/night-watch/builds/186810067

2.11 does not:

Repro should be as simple as

$ cat some.yml | yq '' > /dev/null

(I used to use this as a dummy check for the input YAML validity)

kislyuk commented 3 years ago

When I run your repro, the command works fine in both versions.

What you're observing might be related to https://github.com/kislyuk/yq/pull/102 and related changes to tty sniffing, but I'd ask you to provide a working repro to address any issues that you see.

webknjaz commented 3 years ago

@kislyuk it's that repo that does not work. But I've reverted the version to 2.10 (https://github.com/aio-libs/night-watch/commit/2720096e2c941429cb2f37e4e2a550996b6ad793) in master. You can clone it and check out something like HEAD~2 which does not restrict the version in pip install.

webknjaz commented 3 years ago

P.S. Since the env is Travis CI, you may be right that it's because of TTY. Is there a flag to enforce the old behavior?

kislyuk commented 3 years ago

No, the new behavior is explicitly designed to mimic jq's behavior, which yq is a wrapper for.

I think I've found the issue, I'll make a bug fix release if tests pass.

kislyuk commented 3 years ago

Released in v2.11.1, please test.

webknjaz commented 3 years ago

I confirm that this fixes the issue.