jaq icon indicating copy to clipboard operation
jaq copied to clipboard

support `input_filename`

Open jyn514 opened this issue 6 months ago • 0 comments

jq documents input_filename as follows: https://jqlang.github.io/jq/manual/#input_filename

Returns the name of the file whose input is currently being filtered. Note that this will not work well unless jq is running in a UTF-8 locale.

jaq returns an error instead.

Error: undefined filter
   ╭─[<unknown>:1:35]
   │
 1 │ select(.name == "asdfasdfasdf") | input_filename
   │                                   ───────┬──────
   │                                          ╰──────── undefined filter
───╯

jyn514 avatar Jan 03 '24 23:01 jyn514