Mercurial > hg > octave-nkf
comparison src/octave.cc @ 6365:ccdb8ffbb994
[project @ 2007-02-27 19:43:35 by jwe]
author | jwe |
---|---|
date | Tue, 27 Feb 2007 19:43:36 +0000 |
parents | 645605133a6f |
children | ef5113474882 |
comparison
equal
deleted
inserted
replaced
6364:0d41cafd2e0d | 6365:ccdb8ffbb994 |
---|---|
104 | 104 |
105 // TRUE means we read the site-wide octaverc files. | 105 // TRUE means we read the site-wide octaverc files. |
106 // (--norc; --no-site-file; -f) | 106 // (--norc; --no-site-file; -f) |
107 static bool read_site_files = true; | 107 static bool read_site_files = true; |
108 | 108 |
109 // TRUE means we set the initial path to configured defaults. | |
110 // (--no-initial-path) | |
111 static bool set_initial_path = true; | |
112 | |
109 // TRUE means we don't print the usual startup message. | 113 // TRUE means we don't print the usual startup message. |
110 // (--quiet; --silent; -q) | 114 // (--quiet; --silent; -q) |
111 static bool inhibit_startup_message = false; | 115 static bool inhibit_startup_message = false; |
112 | 116 |
113 // TRUE means we turn on compatibility options. | 117 // TRUE means we turn on compatibility options. |
121 // Usage message | 125 // Usage message |
122 static const char *usage_string = | 126 static const char *usage_string = |
123 "octave [-?HVdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\ | 127 "octave [-?HVdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\ |
124 [--exec-path path] [--help] [--image-path path] [--info-file file]\n\ | 128 [--exec-path path] [--help] [--image-path path] [--info-file file]\n\ |
125 [--info-program prog] [--interactive] [--no-history] [--no-init-file]\n\ | 129 [--info-program prog] [--interactive] [--no-history] [--no-init-file]\n\ |
126 [--no-line-editing] [--no-site-file] [-p path] [--path path]\n\ | 130 [--no-line-editing] [--no-site-file] [--no-init-path] [-p path]\n\ |
127 [--silent] [--traditional] [--verbose] [--version] [file]"; | 131 [--path path] [--silent] [--traditional] [--verbose] [--version] [file]"; |
128 | 132 |
129 // This is here so that it's more likely that the usage message and | 133 // This is here so that it's more likely that the usage message and |
130 // the real set of options will agree. Note: the `+' must come first | 134 // the real set of options will agree. Note: the `+' must come first |
131 // to prevent getopt from permuting arguments! | 135 // to prevent getopt from permuting arguments! |
132 static const char *short_opts = "+?HVdfhip:qvx"; | 136 static const char *short_opts = "+?HVdfhip:qvx"; |
145 #define INFO_FILE_OPTION 4 | 149 #define INFO_FILE_OPTION 4 |
146 #define INFO_PROG_OPTION 5 | 150 #define INFO_PROG_OPTION 5 |
147 #define NO_INIT_FILE_OPTION 6 | 151 #define NO_INIT_FILE_OPTION 6 |
148 #define NO_LINE_EDITING_OPTION 7 | 152 #define NO_LINE_EDITING_OPTION 7 |
149 #define NO_SITE_FILE_OPTION 8 | 153 #define NO_SITE_FILE_OPTION 8 |
150 #define PERSIST_OPTION 9 | 154 #define NO_INITIAL_PATH_OPTION 9 |
151 #define TRADITIONAL_OPTION 10 | 155 #define PERSIST_OPTION 10 |
156 #define TRADITIONAL_OPTION 11 | |
152 long_options long_opts[] = | 157 long_options long_opts[] = |
153 { | 158 { |
154 { "debug", prog_args::no_arg, 0, 'd' }, | 159 { "debug", prog_args::no_arg, 0, 'd' }, |
155 { "braindead", prog_args::no_arg, 0, TRADITIONAL_OPTION }, | 160 { "braindead", prog_args::no_arg, 0, TRADITIONAL_OPTION }, |
156 { "echo-commands", prog_args::no_arg, 0, 'x' }, | 161 { "echo-commands", prog_args::no_arg, 0, 'x' }, |
163 { "interactive", prog_args::no_arg, 0, 'i' }, | 168 { "interactive", prog_args::no_arg, 0, 'i' }, |
164 { "no-history", prog_args::no_arg, 0, 'H' }, | 169 { "no-history", prog_args::no_arg, 0, 'H' }, |
165 { "no-init-file", prog_args::no_arg, 0, NO_INIT_FILE_OPTION }, | 170 { "no-init-file", prog_args::no_arg, 0, NO_INIT_FILE_OPTION }, |
166 { "no-line-editing", prog_args::no_arg, 0, NO_LINE_EDITING_OPTION }, | 171 { "no-line-editing", prog_args::no_arg, 0, NO_LINE_EDITING_OPTION }, |
167 { "no-site-file", prog_args::no_arg, 0, NO_SITE_FILE_OPTION }, | 172 { "no-site-file", prog_args::no_arg, 0, NO_SITE_FILE_OPTION }, |
173 { "no-initial-path", prog_args::no_arg, 0, NO_INITIAL_PATH_OPTION }, | |
168 { "norc", prog_args::no_arg, 0, 'f' }, | 174 { "norc", prog_args::no_arg, 0, 'f' }, |
169 { "path", prog_args::required_arg, 0, 'p' }, | 175 { "path", prog_args::required_arg, 0, 'p' }, |
170 { "persist", prog_args::no_arg, 0, PERSIST_OPTION }, | 176 { "persist", prog_args::no_arg, 0, PERSIST_OPTION }, |
171 { "quiet", prog_args::no_arg, 0, 'q' }, | 177 { "quiet", prog_args::no_arg, 0, 'q' }, |
172 { "silent", prog_args::no_arg, 0, 'q' }, | 178 { "silent", prog_args::no_arg, 0, 'q' }, |
644 | 650 |
645 case NO_SITE_FILE_OPTION: | 651 case NO_SITE_FILE_OPTION: |
646 read_site_files = 0; | 652 read_site_files = 0; |
647 break; | 653 break; |
648 | 654 |
655 case NO_INITIAL_PATH_OPTION: | |
656 set_initial_path = false; | |
657 break; | |
658 | |
649 case TRADITIONAL_OPTION: | 659 case TRADITIONAL_OPTION: |
650 traditional = true; | 660 traditional = true; |
651 break; | 661 break; |
652 | 662 |
653 case PERSIST_OPTION: | 663 case PERSIST_OPTION: |
681 | 691 |
682 octave_interpreter_ready = true; | 692 octave_interpreter_ready = true; |
683 | 693 |
684 initialize_version_info (); | 694 initialize_version_info (); |
685 | 695 |
686 load_path::initialize (); | 696 load_path::initialize (set_initial_path); |
687 | 697 |
688 execute_startup_files (); | 698 execute_startup_files (); |
689 | 699 |
690 initialize_history (); | 700 initialize_history (); |
691 | 701 |