jzelinskie / faq

Format Agnostic jQ -- process various formats with libjq
Apache License 2.0
434 stars 14 forks source link

Stream input files instead of reading entire contents #61

Closed chancez closed 5 years ago

chancez commented 5 years ago

Also supports streaming input from stdin and removes the requirement for of passing any files to faq, defaulting to stdin if no file args are specified.

I removed the usage of linguist because it's not really helping and I felt my custom code to detect xml/yaml/json is sufficient, along with the existing filename extension based detection. We could continue to use linguist, but it would mean we need to read a lot more of the file's contents (maybe all of it?) and pass those contents to lingust, which makes things complicated since the bufio.Reader buffer is of limited length.

chancez commented 5 years ago

Okay, I fixed the review comments and added back linguist detection. I rebased on top of #62 because I found a bug in decoding logic while handling this and wanted to fix that independently of this PR.