kislyuk / yq

Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
https://kislyuk.github.io/yq/
Apache License 2.0
2.57k stars 82 forks source link

xq: Bug with --slurpfile? #132

Closed PenelopeFudd closed 7 months ago

PenelopeFudd commented 3 years ago

Hi;

This example generates half xml/half internal-format output:

cat << 'EOF' > a.json
[  { "copy": { } } ]
EOF

xq -x --xml-root=a --slurpfile a a.json '$a' <<< '<a/>'

<a>[OrderedDict([('copy', OrderedDict())])]</a>

I'm guessing --slurpfile a a.json has a bug, because replacing it with --argjson a "$(cat a.json)" works as expected.

Thanks for the fine program! :-)

kislyuk commented 7 months ago

Sorry about missing this issue, @PenelopeFudd. I just ran your example and confirmed that this bug has since been fixed. Thank you for reporting.