jzelinskie / faq

Format Agnostic jQ -- process various formats with libjq

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support reading jq program/filter from file

chancez opened this issue · comments

jq has the following flag as an option:

       o   -f filename / --from-file filename:

           Read filter from the file rather than from a command line, like awk's -f option. You can also use '#' to make comments.

faq should have something similar.

This conflicts with the existing -f flag which is for the input format, but I can understand the desire to add this functionality. A workaround could be using the party hat operator:

$ faq '.' <(cat myFile.json)

I'm an idiot, this does exist.

-F, --program-file string If specified, read the file provided as the jq program for faq.

I even added it. I just had an old cached build around.

I wonder if we should swap the flags for compat, though.