Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling of jq_filter and files #102

Merged
merged 3 commits into from
Sep 2, 2020

Conversation

dprunier
Copy link
Contributor

This PR tries to restore the behavior which I believe was expected, based on JQ behavior.

Valid usage are:

  • yq < file (not working with yq-2.10.1)
  • yq filter < file
  • yq filter file
  • yq filter file1 file2 ...
  • yq -f filter < file (not working with yq-2.10.1)
  • yq -f filter file (not working with yq-2.10.1)
  • yq -f filter file1 file2 ...

Invalid usage are:

  • yq on a TTY
  • yq filter on a TTY
  • yq -f filter on a TTY

@kislyuk
Copy link
Owner

kislyuk commented Aug 19, 2020

Thank you! You are absolutely right, these inconsistencies with the jq API need to be corrected.

Would you mind adding test assertions in test/test.py, just asserting that the commands succeed?

@dprunier
Copy link
Contributor Author

Sorry, was on holidays. Yes, i will add these. Thanks.

@dprunier
Copy link
Contributor Author

@kislyuk I just added a test case, which uncovered a regression (who says tests aren't useful :D)

@kislyuk kislyuk merged commit 6fd33bb into kislyuk:develop Sep 2, 2020
@kislyuk
Copy link
Owner

kislyuk commented Sep 2, 2020

Thanks! Really appreciate your help with this, and the thorough test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants