toml-patch

Crates.iotoml-patch
lib.rstoml-patch
version0.1.0
created_at2024-12-25 13:12:31.528595+00
updated_at2024-12-25 13:12:31.528595+00
descriptionA command-line tool to apply updates from a JSON file to a TOML file, while preserving comments.
homepage
repositoryhttps://git.push-f.com/toml-patch/
max_upload_size
id1495006
size13,119
Martin Fischer (not-my-profile)

documentation

README

toml-patch

A command-line tool to apply updates from a JSON file to a TOML file, while preserving comments in the latter (thanks to toml_edit).

$ toml-patch <(echo '# test\na=true') <(echo '{"x": {"y": 42}}')
# test
a=true

[x]
y = 42

Note that the JSON document must be a JSON object and that null values will result in existing key/value pairs being removed.

By default the updated TOML document is printed to stdout, you can pass --write to instead overwrite the specified TOML file.

Limitations

  • No partial updates for arrays.

  • No support for setting any of TOMLs date/time types.

Commit count: 0

cargo fmt