Here are my patches for command line option --version. I first copied
the gnome 'about' box information.
I don't rightly know the proper naming convention. I would much
rather have a file included somewhere (for both this and the 'about'
box), or a check somewhere done so that the version code could say
"version: gnome cvs 19991112" or something like that.
If it were to be a date for the cvs versions, how to keep the string
up-to-date? A cron job on the cvs server? My entire reason for
asking for this feature was so I could report the version with my bug
reports. I actually like the idea of a cron job on the cvs server, or
something like that.
I had no idea what to put in for the authors string, so I left it out.
In the gnome version, src/gnome/window-main.c, line 380,
gnc_ui_about_cb() is pretty straightforward. I remembered the motif
version, and tried to find the about box there. After a bit more
work, I found Docs/En/xacc-about.html. That is where most of the text
came from. I would like to see this made more right, and I guess it
should go into a message file which has all the different languages
supported. I checked the --version output of xemacs, Eterm and bash,
and they were all kinds of different. :-(
One warning. I know _nothing_ about scheme. All I know is that it
kind of resembles my 70k of xemacs startup files. :-)
rob
*** src/scm/command-line.scm.orig Mon Nov 22 20:51:04 1999
--- src/scm/command-line.scm Mon Nov 22 21:40:02 1999
***************
*** 7,12 ****
--- 7,17 ----
(list
(cons
+ "version"
+ (cons 'boolean
+ (lambda (val)
+ (gnc:config-var-value-set! gnc:*arg-show-version* #f val))))
+ (cons
"usage"
(cons 'boolean
(lambda (val)
***************
*** 91,96 ****
--- 96,104 ----
(define (gnc:cmd-line-get-string-arg args)
(gnc:debug "got string arg returning " (car args) " and " (cdr args))
(list (car args) (cdr args)))
+
+ (define (gnc:prefs-show-version)
+ (display "GnuCash 1.3 development version") (newline))
(define (gnc:prefs-show-usage)
(display "usage: gnucash [ option ... ] [ datafile ]") (newline))
*** src/scm/main.scm.orig Mon Nov 22 20:51:15 1999
--- src/scm/main.scm Mon Nov 22 21:02:58 1999
***************
*** 21,26 ****
--- 21,31 ----
(gnc:hook-run-danglers gnc:*startup-hook*)
+ (if (gnc:config-var-value-get gnc:*arg-show-version*)
+ (begin
+ (gnc:prefs-show-version)
+ (gnc:shutdown 0)))
+
(if (or (gnc:config-var-value-get gnc:*arg-show-usage*)
(gnc:config-var-value-get gnc:*arg-show-help*))
(begin
*** src/scm/prefs.scm.orig Mon Nov 22 18:11:12 1999
--- src/scm/prefs.scm Mon Nov 22 20:55:38 1999
***************
*** 231,236 ****
--- 231,243 ----
"h" "Show the account balance column in the account tree." #t))
+ (define gnc:*arg-show-version*
+ (gnc:make-config-var
+ "Show version."
+ (lambda (var value) (if (boolean? value) (list value) #f))
+ eq?
+ #f))
+
(define gnc:*arg-show-usage*
(gnc:make-config-var
"Generate an argument summary."
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]