Closed tocklime closed 5 years ago
Good idea! I'll implement reading from stdin. The parsing/serialization speed should not be a problem. Even on modest hardware you should be able to a perform a dozen of set
operations on 10k lines in under a second.
For option 1 it would be best to switch the argument order from initool s file.ini section key value
to initool file.ini s section key value
. It would read better in pipelines, too. It's something I'll consider.
It would be nice if there were some provision so I can make (say) 3 edits to the same file, without having to write it out to disk each time.
I can think of a couple of ways to do this:
initool s myFile.ini path1 key1 value1 s path2 key2 value2 d path3 key3
The argument order gets a bit weird there though, maybe have a new command 'm' for multiple?initool s myFile.ini path1 key1 value1 | initool s - path2 key2 value2 | ...
Of course you're re-parsing the file each time then, which might be a problem for huge ini files, but it's no worse than what you'd have to do currently.
Reading stdin would be useful for other things too, I'm sure.
Or have I missed an existing feature?