From 9f38fa9e1aac1b19d086fbdc31c25d89c4981362 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sun, 10 Nov 2024 10:53:38 +0100 Subject: initial commit --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..b2954d8 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# 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. + + +[toml_edit]: https://crates.io/crates/toml_edit -- cgit v1.2.3