Closed vbatts closed 4 years ago
This is on faq v0.0.6
?
vbatts@infra1:~$ faq --version
0.0.6
Try -ojson
when using -r
and maybe -c
. I think it's broken with non-JSON output.
@chancez it already defaulted to json output. Adding that flag did not change anything.
vbatts@infra1:~$ curl -s https://api.github.com/repos/flatcar-linux/manifest/releases | faq -f json -o json -r '.[0].tag_name'
Error: failed to encode as pretty: invalid character 'v' looking for beginning of value
Usage:
faq [flags] [filter string] [files...]
[...]
p.s. despite erroring out, the return code is from this is still 0
Try -c
. It's trying to pretty the raw output, which cannot be done.
@chancez maybe we should just add
if rawOutput {
outputConf.Color = false
outputConf.Pretty = false
}
The original jq (and early faq) handled this at flag-parsing time, but it honestly seems more sane to do it at the call site.
I'd agree with that.
faq
seems to be expected raw values to act a certain way?