GnuCash command line

Rob Browning rlb@cs.utexas.edu
15 Jan 2001 00:36:39 -0600


Dave Peticolas <dave@krondo.com> writes:

> Thanks! The functionality you describe doesn't exist and it would be
> pretty cool.

Yep, it's been on my todo list forever...

> The perl API into the engine is deprecated so using guile for the
> actual data manipulations would probably be easier. The CVS version
> of gnucash has support for running guile code passed into the
> command line.

I'd be happy to help with this, but I can't do it myself right now.
As Dave suggested, I think the right way to do it would be to write a
guile script that handles the job.  That'd also make it easier to
develop/debug.

The latest version of gnucash supports --load (and --evaluate), so you
can run

  gnucash --evaluate '(display 42)'

and gnucash will fire-up, print 42, and exit.

Similarly, you can run

  gnucash --load ~/my-file.scm

and it'll execute the code in my-file.scm and quit.

You could start with something simple like

  (display "Hello world.\n")

just to make sure you've got things working right.

Also, if you've never programmed scheme before, and you'd like to
start, I'd highly recommend working in an editor that can match
parentheses for you -- my personal suggestion is emacs.

In any case, if you're willing to plug away at this, we can probably
help you find the right functions, etc. to get the script working.
Off the top of my head, I can't tell how much work it'll be, though.

Hope this helps.

-- 
Rob Browning <rlb@cs.utexas.edu> PGP=E80E0D04F521A094 532B97F5D64E3930