Closed dcompoze closed 1 year ago
Correct, sponge is the right utility to use in this case. jq does not support -i, so -i is only available when we are capturing and converting jq's output.
Sorry, I misread that. What you're pointing out is a bug. tomlq -t
should support -i.
Version: tomlq 2.12.2
The
--help
documentation says that it's possible to update in place using the-i
flag:But when invoked I get an error:
Which seems to suggest that only
yaml
files can be updated in-place.I ended up using the
sponge
utility from themoreutils
package:tomlq --toml-output '<query>' Foo.toml | sponge Foo.toml
. But sincetomlq
already knows how to return toml output it would seem rather straight-forward to make the-i
flag work the same way it works withyq
.