-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[feature request] system(command; args) filter #1614
Comments
I would really hope that we wouldn't support At bare minimum, any such interface should allow multiple arguments so the OS-level
Even then, since |
Although I agree that (I'll see about not using |
In particular this feature would also allow to collect and merge data via web APIs with curl. The |
@nichtich yes, the thought has occurred :) |
It would be nice to allow external commands that take JSON in and return JSON out to be embedded in a pipeline of jq filters. an example use case would be mapping over an array of objects, converting an object member to a Longest Common Substring -matched element from a reference array using an external command, and picking up jq execution with that output.
"command" would be a string representing the name/path of the command
args would be an object representing arguments to the command.
parsing semantics demonstration:
would feed each item of our input array to stdin of
mylookup -f --dict="mydict.tsv" -o "json"
assumptions of posix compliance could be overridden by prefixing a key with '-', for example to specify args to
find
. to handle more significant deviations, or even the one just mentioned, users could use string interpolation to build the call using 'command', leaving args blank.I may be in the minority, but I find the jq syntax for transformations and control flow to be very elegant and easily understandable. I'd rather call complicated routines from jq than vice versa in many cases. It would be trivial to wrap a system filter in a function, then include that as a module.
The text was updated successfully, but these errors were encountered: