Not possible to specify jsonl (JSON lines) in the language parameter
I follow logs of a Kubernetes pod. Those logs are in jsonl format (https://jsonlines.org/), where each line is a valid and complete JSON entry.
I see jsonl support is added here: https://github.com/sharkdp/bat/pull/2539. However, it only uses jsonl format if a file name ends with .jsonl. In my case, I use a pipe like
kubectl logs -n my-pod --follow | bat --paging=never -l jsonl
which doesn't work: [bat error]: unknown syntax: 'jsonl'
Is it possible to add a separate language entry for jsonl?
Currently the .jsonl files are mapped to the JSON syntax so you should be able to just use -l json.
But in case of a pipe, the tool won't understand that the input is jsonl and not json, hence not doing the syntax highlighting properly.
Think this was a misunderstanding—Keith was saying to pass -l json, not -l jsonl (which errors as shown in the issue description).
But in case of a pipe, the tool won't understand that the input is
jsonland notjson, hence not doing the syntax highlighting properly.
The original issue was about passing -l jsonl as a flag (which doesn't exist), not about bat inferring file types. Keith wasn't suggesting bat auto-detects format over pipes, that's not a feature bat has.
Since -l json works for jsonl content, think this can be closed.
In general, bat can try to guess formats from the first line. There is currently no separate syntax highlighting for json vs jsonl, both are highlighted fine with the json syntax definition