diff src/octave.cc @ 721:54a6858bc7e7

[project @ 1994-09-21 15:17:38 by jwe]
author jwe
date Wed, 21 Sep 1994 15:19:08 +0000
parents 36ba0576bd1b
children a2f9d3fd720c
line wrap: on
line diff
--- a/src/octave.cc
+++ b/src/octave.cc
@@ -66,6 +66,7 @@
 #include "octave.h"
 #include "parse.h"
 #include "defaults.h"
+#include "user-prefs.h"
 #include "procstream.h"
 #include "unwind-prot.h"
 #include "octave-hist.h"
@@ -419,29 +420,33 @@
   exit (0);
 }
 
+static void
+initialize_error_handlers ()
+{
+  set_Complex_error_handler (octave_Complex_error_handler);
+
+  set_liboctave_error_handler (error);
+}
+
 // You guessed it.
 
 int
 main (int argc, char **argv)
 {
-// Allow for system dependent initialization.  See sysdep.cc for more
-// details.
+// The order of these calls is important, and initialize globals must
+// come before the options are processed because some command line
+// options override defaults.
+
+  init_user_prefs ();
+
+  initialize_pager ();
+
   sysdep_init ();
 
-// This is not really the right place to do this...
-  set_Complex_error_handler (octave_Complex_error_handler);
-
-// Or this, probably...
-  set_liboctave_error_handler (error);
+  initialize_error_handlers ();
 
-// Do this first, since some command line arguments may override the
-// defaults.
   initialize_globals (argv[0]);
 
-// Initialize dynamic linking.  This might not do anything.  Must
-// happen after initializing raw_prog_name.
-  init_dynamic_linker ();
-
   int optc;
   while ((optc = getopt_long (argc, argv, short_opts, long_opts, 0)) != EOF)
     {
@@ -490,7 +495,8 @@
   atexit (cleanup_tmp_files);
 #endif
 
-  initialize_pager ();
+// These can come after command line args since none of them set any
+// defaults that might be changed by command line options.
 
   install_signal_handlers ();
 
@@ -504,6 +510,8 @@
 
   initialize_readline ();
 
+  init_dynamic_linker ();
+
   if (! inhibit_startup_message)
     cout << "Octave, version " << version_string
 	 << ".  Copyright (C) 1992, 1993, 1994 John W. Eaton.\n"