On 16 Jan 2000 10:28:01 EST, the world broke into rejoicing as
Derek Atkins <[EMAIL PROTECTED]> said:
> I think that a ~/.gnucashrc would be the right place to save
> preferences.
This shouldn't need to be *overly* difficult to handle in a flexible
manner.
Would it be an unreasonable idea to set up a set of default locations
in which GnuCash should look for configuration, falling back as needed?
Here's a Guile code fragment that might be feasible for the purpose.
Feel free to add/modify as needed.
(define (get-config-location)
(let ((envar (getenv "GNUCASH_CONFIG"))
(userhome (string-append (getenv "HOME")
"/.gnucash/gnucash.conf"))
(local "/usr/local/etc/gnucash.conf")
(etc "/etc/gnucash.conf"))
(cond
((file-exists? envar) envar)
((file-exists? userhome) userhome)
((file-exists? local) local)
((file-exists? etc) etc)
(else
#f ;;; Error - no configuration found!))))
This moves from most specific, namely an environment variable, to more
generic choices.
It would be quite logical to add in a first option of a config file
specified on the command line that would override any of the other
options; I'm not 100% sure how to get at that, and would be happy to
see an extension to that end.
Note that if no config file is found, a false value is returned, and
should be checked for.
--
Wiener's Law of Libraries:
There are no answers, only cross references.
[EMAIL PROTECTED] - <http://www.ntlug.org/~cbbrowne/lsf.html>
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]