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

Support reading filter expression from file #1120

Closed
mouchar opened this issue Feb 23, 2022 · 2 comments
Closed

Support reading filter expression from file #1120

mouchar opened this issue Feb 23, 2022 · 2 comments

Comments

@mouchar
Copy link

mouchar commented Feb 23, 2022

I'd like to pass expression as a file, the same way as I can with similar tools (jq -f program-file, awk -f file,...). As -f option already serves another purpose, a new option --from-file filter-file borrowed from jq would be fine.

This option could also allow me to pass filter using bash process substitution, like in yq e --from-file <(generate-yq-filter.sh) /path/to/file.yaml, to avoid unnecessary temporary files if the filter needs to be generated.

It would also resolve various issues with special characters, shell-quoting troubles, and so on.

@mikefarah
Copy link
Owner

Related: #1103 - I think there's enough people asking for this to add it - will add in the next release

mikefarah added a commit that referenced this issue Mar 1, 2022
@mikefarah
Copy link
Owner

Fixed in 4.22.1

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

No branches or pull requests

2 participants