[Gnucash-changes] r12879 - gnucash/trunk/src - Move "unstable development version" message from guile to C.

Chris Shoemaker chris at cvs.gnucash.org
Wed Jan 18 23:29:08 EST 2006


Author: chris
Date: 2006-01-18 23:29:07 -0500 (Wed, 18 Jan 2006)
New Revision: 12879
Trac: http://svn.gnucash.org/trac/changeset/12879

Modified:
   gnucash/trunk/src/bin/Makefile.am
   gnucash/trunk/src/bin/gnucash-bin.c
   gnucash/trunk/src/scm/command-line.scm
   gnucash/trunk/src/scm/main.scm
Log:
  Move "unstable development version" message from guile to C.
  Remove crufty guile command-line options.


Modified: gnucash/trunk/src/bin/Makefile.am
===================================================================
--- gnucash/trunk/src/bin/Makefile.am	2006-01-19 04:09:00 UTC (rev 12878)
+++ gnucash/trunk/src/bin/Makefile.am	2006-01-19 04:29:07 UTC (rev 12879)
@@ -2,6 +2,7 @@
 SUBDIRS = . overrides test
 
 AM_CFLAGS = -I${top_builddir} ${GLIB_CFLAGS} ${GNOME_CFLAGS} ${GTK_CFLAGS} \
+${QOF_CFLAGS} \
 -I${top_srcdir}/src/gnome-utils \
 -I${top_builddir}/src/gnome-utils \
 -I${top_srcdir}/src/gnc-module
@@ -9,6 +10,7 @@
 bin_PROGRAMS = gnucash-bin
 gnucash_bin_SOURCES = gnucash-bin.c
 gnucash_bin_LDADD = ${GUILE_LIBS} ${GLIB_LIBS} ${GNOME_LIBS} ${GTK_LIBS} \
+${QOF_LIBS} \
 ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
 ${top_builddir}/src/gnc-module/libgncmodule.la
 

Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2006-01-19 04:09:00 UTC (rev 12878)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2006-01-19 04:29:07 UTC (rev 12879)
@@ -34,10 +34,25 @@
 #include "gnc-module.h"
 #include "i18n.h"
 #include "gnc-version.h"
+#include "gnc-file.h"
 
 static int gnucash_show_version;
 static int is_development_version = TRUE;
 
+static void
+gnc_print_unstable_message(void)
+{
+    if (!is_development_version) return;
+
+    printf("\n\n%s%s%s%s%s\n%s%s\n\n",
+           _("This is a development version. It may or may not work.\n"),
+           _("Report bugs and other problems to gnucash-devel at gnucash.org.\n"),
+           _("You can also lookup and file bug reports at http://bugzilla.gnome.org\n"),
+           _("The last stable version was "), "GnuCash 1.8.12",
+           _("The next stable version will be "), "GnuCash 2.0");
+}
+
+
 /* Note: Command-line argument parsing for Gtk+ applications has
  * evolved.  Gtk+-2.4 and before use the "popt" method.  We use that
  * here for compatibility.  Gnome-2.4 has a way of wrapping the "popt"
@@ -80,10 +95,6 @@
          _("Set shared data file search path"), _("SHAREPATH")},
         {"doc-path", '\0', POPT_ARG_STRING, NULL, 0,
          _("Set the search path for documentation files"), _("DOCPATH")},
-        {"evaluate", '\0', POPT_ARG_STRING, NULL, 0,
-         _("Evaluate the guile command"), _("COMMAND")},
-        {"load", '\0', POPT_ARG_STRING, NULL, 0,
-         _("Load the given .scm file"), _("FILE")},
         {"add-price-quotes", '\0', POPT_ARG_STRING, NULL, 0,
          _("Add price quotes to given FILE"), _("FILE")},
         {"namespace", '\0', POPT_ARG_STRING, NULL, 0, 
@@ -93,9 +104,6 @@
          _("Load the user configuration"), NULL},
         {"load-system-config", '\0', POPT_ARG_NONE, NULL, 0,
          _("Load the system configuration"), NULL},
-        {"rpc-server", '\0', POPT_ARG_NONE, NULL, 0,
-         _("Run the RPC Server if GnuCash was configured with --enable-rpc"), 
-         NULL},
         POPT_TABLEEND
     };
     
@@ -166,6 +174,7 @@
     gtk_init (&argc, &argv);
     gnc_module_system_init();
     gnucash_command_line(argc, argv);
+    gnc_print_unstable_message();
 
     scm_boot_guile(argc, argv, inner_main, 0);
     exit(0); /* never reached */

Modified: gnucash/trunk/src/scm/command-line.scm
===================================================================
--- gnucash/trunk/src/scm/command-line.scm	2006-01-19 04:09:00 UTC (rev 12878)
+++ gnucash/trunk/src/scm/command-line.scm	2006-01-19 04:29:07 UTC (rev 12879)
@@ -22,9 +22,6 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Configuration variables
 
-(define gnc:*arg-show-version* #f)
-(define gnc:*arg-show-usage* #f)
-(define gnc:*arg-show-help* #f)
 (define gnc:*arg-no-file* #f)
 (define gnc:*loglevel* #f)
 
@@ -73,27 +70,6 @@
 (define (gnc:initialize-config-vars)
   ;; We use a function so we don't do this at file load time.
   
-  (set! gnc:*arg-show-version*
-        (gnc:make-config-var
-         (N_ "Show version.")
-         (lambda (var value) (if (boolean? value) (list value) #f))
-         eq?
-         #f))
-  
-  (set! gnc:*arg-show-usage*
-        (gnc:make-config-var
-         (N_ "Generate an argument summary.")
-         (lambda (var value) (if (boolean? value) (list value) #f))
-         eq?
-         #f))
-  
-  (set! gnc:*arg-show-help*
-        (gnc:make-config-var
-         (N_ "Generate an argument summary.")
-         (lambda (var value) (if (boolean? value) (list value) #f))
-         eq?
-         #f))
-  
   (set! gnc:*arg-no-file*
         (gnc:make-config-var
          (N_ "Don't load any file, including autoloading the last file.")
@@ -190,27 +166,6 @@
 ;; for now since it doesn't depend on running any code.
 (define gnc:*arg-defs*
   (list
-   (list "version"
-         'boolean
-         (lambda (val)
-           (gnc:config-var-value-set! gnc:*arg-show-version* #f val))
-         #f
-         (N_ "Show GnuCash version"))
-
-   (list "usage"
-         'boolean
-         (lambda (val)
-           (gnc:config-var-value-set! gnc:*arg-show-usage* #f val))
-         #f
-         (N_ "Show GnuCash usage information"))
-
-   (list "help"
-         'boolean
-         (lambda (val)
-           (gnc:config-var-value-set! gnc:*arg-show-help* #f val))
-         #f
-         (N_ "Show this help message"))
-
    (list "debug"
          'boolean
          (lambda (val)
@@ -278,24 +233,6 @@
          "DOCPATH"
          (N_ "Set the search path for documentation files"))
    
-   (list "evaluate"
-         'string
-         (lambda (val)
-           (set! gnc:*batch-mode-things-to-do*
-                 (cons val gnc:*batch-mode-things-to-do*)))
-         "COMMAND"
-         (N_ "Evaluate the guile command"))
-
-   ;; Given a string, --load will load the indicated file, if possible.
-   (list "load"
-         'string
-         (lambda (val)
-           (set! gnc:*batch-mode-things-to-do*
-                 (cons (lambda () (load val))
-                       gnc:*batch-mode-things-to-do*)))
-         "FILE"
-         (N_ "Load the given .scm file"))
-
    (list "add-price-quotes"
          'string
          (lambda (val)
@@ -334,14 +271,8 @@
          gnc:load-system-config-if-needed
          #f
          (N_ "Load the system configuration"))
+))
 
-   (list "rpc-server"
-	 'boolean
-	 (lambda (val)
-	   (if val (gnc:run-rpc-server)))
-	 #f
-	 (N_ "Run the RPC Server if GnuCash was configured with --enable-rpc"))))
-
 (define (gnc:cmd-line-get-boolean-arg args)
   ;; --arg         means #t
   ;; --arg true    means #t
@@ -372,36 +303,6 @@
       (list (car args) (cdr args))
       (begin (gnc:warn "no argument given where one expected") #f)))
 
-(define (gnc:prefs-show-usage)
-  (display "Usage: gnucash [ option ... ] [ datafile ]")
-  (newline) (newline)
-  (let ((max 0))
-    (map (lambda (arg-def)
-           (let* ((name (car arg-def))
-                  (arg (cadddr arg-def))
-                  (len (+ 4 (string-length name)
-                          (if arg (+ (string-length arg) 1) 0))))
-             (if (> len max)
-                 (set! max len))))
-         gnc:*arg-defs*)
-    (set! max (+ max 4))
-    (map (lambda (arg-def)
-           (let* ((name (car arg-def))
-                  (arg (cadddr arg-def))
-                  (len (+ 4 (string-length name)
-                          (if arg (+ (string-length arg) 1) 0)))
-                  (help (car (cddddr arg-def))))
-             (display "  --")
-             (display name)
-             (if arg
-                 (begin
-                   (display " ")
-                   (display arg)))
-             (display (make-string (- max len) #\ ))
-             (display (_ help))
-             (newline)))
-         gnc:*arg-defs*)))
-
 ;;(define (gnc:handle-command-line-args)
 ;;  (letrec ((internal
 ;;            (lambda ()

Modified: gnucash/trunk/src/scm/main.scm
===================================================================
--- gnucash/trunk/src/scm/main.scm	2006-01-19 04:09:00 UTC (rev 12878)
+++ gnucash/trunk/src/scm/main.scm	2006-01-19 04:29:07 UTC (rev 12879)
@@ -348,19 +348,6 @@
             (gnc:find-file file (list (car dirs)))
             (loop prefixes (cdr dirs))))))
 
-(define (gnc:print-unstable-message)
-  (if
-   gnc:*is-development-version?*
-   (display
-    (string-append
-     "\n\n"
-     (_ "This is a development version. It may or may not work.\n")
-     (_ "Report bugs and other problems to gnucash-devel at gnucash.org.\n")
-     (_ "You can also lookup and file bug reports at http://bugzilla.gnome.org\n")
-     (_ "The last stable version was ") "GnuCash 1.8.12" "\n"
-     (_ "The next stable version will be ") "GnuCash 2.0"
-     "\n\n"))))
-
 (define (gnc:startup-pass-1)
   (gnc:debug "starting up (1).")
   (gnc:setup-debugging)
@@ -535,7 +522,6 @@
 
   ;; Now the fun begins.
   (gnc:startup-pass-1)
-  (gnc:print-unstable-message)
 
   (if (null? gnc:*batch-mode-things-to-do*)
       (begin



More information about the gnucash-changes mailing list