CashUtil can now load the GnuCash XML backend, select an object (if you know
one of the values), edit (certain parameters of) that object and save the
amended book back to GnuCash XML.
i.e. it is now a semi-usable GnuCash CLI. It's not intuitive yet, but it's
still early days.
Searching for an entity is simply a case of specifying the command - edit,
print or delete - the object type, the parameter to compare and the value to
find in that parameter:
edit Account name Assets
I'll see about enhancing the command parser so that a more verbose command is
also supported :
edit Account where name = Assets
(I prefer the shorthand version myself - there'll be full SQL query support
for the more complex queries.) Parameter names or values that contain spaces
need to be quoted.
edit Account name "Current Assets"
One-line edits will also be supported:
edit Account code 0054 10055
or in verbose:
edit Account where code = 0054 set 10055
equivalent to the SQL:
update Account set code = 10055 where code = 0054;
(which will also be supported within the shell, later.)
Undo is also working, use 'commit' to place the data into the book, quit to
undo the edit and leave the entity unchanged. Users are prompted about dirty
books and 'pre-selection' is also enabled: if only one entity of the
requested type exists there is no need to specify search terms.
I've tested the file written out by CashUtil and GnuCash can load it and
correctly shows the amended data. (For the test, I simply edited the code
parameter of the Assets account.)
$ ./cashutil --shell
cashutil> load books/gnucash.xml
cashutil> print Account name Assets
Name Type Value
Next is to fix the file type identification (between GnuCash and QSF), make
the selection shell more intuitive and helpful (by offering a list of
available objects etc.) and fix some problems with the SQL export where the
objects are copied as empty.