summaryrefslogtreecommitdiff
path: root/README.md
blob: b2954d893d2ae5abe41ad9fb175cc63aaacf14b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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