Dasel: Difference between revisions
From wikinotes
No edit summary |
|||
Line 12: | Line 12: | ||
|} | |} | ||
</blockquote><!-- Documentation --> | </blockquote><!-- Documentation --> | ||
= Examples = | |||
<blockquote> | |||
<syntaxhighlight lang="bash"> | |||
# modify 'foo.yml', adding obj['category']['three'] = "3" | |||
dasel put string \ | |||
-f foo.yml \ | |||
'.category.three' '3' | |||
# modify 'foo.yml', preserving comments | |||
# see: https://stackoverflow.com/questions/14282617/hunk-1-failed-at-1-whats-that-mean | |||
diff \ | |||
<(dasel -r yaml -f foo.yml) \ | |||
<(dasel put string -r yaml -f foo.yml -o -) \ | |||
| patch -o - foo.yml | |||
</syntaxhighlight> | |||
</blockquote><!-- Examples --> |
Revision as of 15:45, 29 August 2021
Inspired by jq and yq, but operates on json, yaml, toml, xml, csv.
Totally standalone, no runtime dependencies.
Documentation
official docs https://daseldocs.tomwright.me/ github https://github.com/TomWright/dasel
Examples
# modify 'foo.yml', adding obj['category']['three'] = "3" dasel put string \ -f foo.yml \ '.category.three' '3' # modify 'foo.yml', preserving comments # see: https://stackoverflow.com/questions/14282617/hunk-1-failed-at-1-whats-that-mean diff \ <(dasel -r yaml -f foo.yml) \ <(dasel put string -r yaml -f foo.yml -o -) \ | patch -o - foo.yml