Replies: 1 comment 5 replies
-
I'm not aware for an CLI tool – googling found some old stuff, but nothing that looked up-to-date. But it should be fairly easy to write, let's say for your example files in Python (untested code): import tomllib
import tomli_w
with open("file1.toml", "rb") as fh:
file1data = tomllib.load(fh)
with open("file2.toml", "rb") as fh:
file2data = tomllib.load(fh)
fileresult_data = file1data | file2data
with open("fileresult_data.toml", "wb") as fh:
tomli_w.dump(fileresult_data, fh) Reading the file names from CLI arguments instead is left as exercise for the reader. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Often I have to merge two TOML files by table header. Here an example what I mean by this:
file1.toml:
file2.toml:
Merged fileresult.toml:
In order to not invent the wheel twice, does a readymade CLI tool for this exist?
Beta Was this translation helpful? Give feedback.
All reactions