summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2024-11-10 10:53:38 +0100
committerMartin Fischer <martin@push-f.com>2024-12-25 14:07:16 +0100
commit9f38fa9e1aac1b19d086fbdc31c25d89c4981362 (patch)
treeb4c08b06f5abeb5b2899bb81c720fb7d51fabc0f /README.md
initial commitHEADmaster
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 26 insertions, 0 deletions
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