1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
20 |
|
21 */ |
|
22 |
|
23 // Born February 20, 1992. |
|
24 |
240
|
25 #ifdef HAVE_CONFIG_H |
1192
|
26 #include <config.h> |
1
|
27 #endif |
|
28 |
1355
|
29 #include <cassert> |
|
30 #include <csignal> |
|
31 #include <cstdlib> |
|
32 #include <cstring> |
|
33 #include <ctime> |
|
34 |
|
35 #include <fstream.h> |
|
36 #include <iostream.h> |
|
37 #include <strstream.h> |
|
38 |
|
39 #ifdef HAVE_UNISTD_H |
2442
|
40 #ifdef HAVE_SYS_TYPES_H |
1
|
41 #include <sys/types.h> |
2442
|
42 #endif |
139
|
43 #include <unistd.h> |
|
44 #endif |
1355
|
45 |
2926
|
46 #include "cmd-edit.h" |
|
47 #include "file-stat.h" |
240
|
48 #include "lo-error.h" |
2926
|
49 #include "oct-env.h" |
1907
|
50 #include "str-vec.h" |
223
|
51 |
2492
|
52 #include <defaults.h> |
1355
|
53 #include "defun.h" |
703
|
54 #include "dynamic-ld.h" |
1355
|
55 #include "error.h" |
|
56 #include "file-io.h" |
1
|
57 #include "input.h" |
|
58 #include "lex.h" |
1742
|
59 #include "oct-hist.h" |
2375
|
60 #include "ops.h" |
1670
|
61 #include "toplev.h" |
1
|
62 #include "parse.h" |
1355
|
63 #include "pathsearch.h" |
2982
|
64 #include "pt-plot.h" |
562
|
65 #include "procstream.h" |
1817
|
66 #include "prog-args.h" |
1355
|
67 #include "sighandlers.h" |
|
68 #include "sysdep.h" |
2375
|
69 #include "ov.h" |
1
|
70 #include "unwind-prot.h" |
1355
|
71 #include "utils.h" |
|
72 #include "variables.h" |
2492
|
73 #include <version.h> |
1
|
74 |
2910
|
75 extern void install_builtins (void); |
|
76 |
1704
|
77 #if !defined (HAVE_ATEXIT) && defined (HAVE_ON_EXIT) |
|
78 extern "C" int on_exit (); |
|
79 #define atexit on_exit |
|
80 #endif |
|
81 |
1792
|
82 // Don't redefine the variables if glibc already has. |
2775
|
83 #if defined (HAVE_PROGRAM_INVOCATION_NAME) || defined (WITH_KPATHSEARCH) |
2470
|
84 extern char *program_invocation_name; |
|
85 extern char *program_invocation_short_name; |
|
86 #else |
1792
|
87 char *program_invocation_name; |
|
88 char *program_invocation_short_name; |
|
89 #endif |
|
90 |
1907
|
91 // The command-line options. |
|
92 static string_vector octave_argv; |
1
|
93 |
2239
|
94 // TRUE means we read ~/.octaverc and ./.octaverc. |
|
95 // (--norc; --no-init-file; -f) |
|
96 static bool read_init_files = true; |
|
97 |
|
98 // TRUE means we read the site-wide octaverc files. |
|
99 // (--norc; --no-site-file; -f) |
2240
|
100 static bool read_site_files = true; |
1
|
101 |
1358
|
102 // Nonzero means we don't print the usual startup message. |
616
|
103 // (--quiet; --silent; -q) |
2239
|
104 static bool inhibit_startup_message = false; |
1
|
105 |
1410
|
106 // Nonzero means we turn on compatibility options. |
|
107 // (--traditional) |
2239
|
108 static bool traditional = false; |
1410
|
109 |
1825
|
110 // If nonzero, print verbose info in some cases. |
|
111 // (--verbose; -V) |
2239
|
112 static bool verbose_flag = false; |
1825
|
113 |
1
|
114 // Usage message |
139
|
115 static const char *usage_string = |
1613
|
116 "octave [-?Vdfhiqvx] [--debug] [--echo-commands] [--exec-path path]\n\ |
2239
|
117 [--help] [--info-file file] [--info-program prog] [--interactive]\n\ |
|
118 [--no-init-file] [--no-line-editing] [--no-site-file] [-p path]\n\ |
|
119 [--path path] [--silent] [--traditional] [--verbose] [--version] [file]"; |
1
|
120 |
1358
|
121 // This is here so that it's more likely that the usage message and |
1410
|
122 // the real set of options will agree. Note: the `+' must come first |
|
123 // to prevent getopt from permuting arguments! |
|
124 static const char *short_opts = "+?Vdfhip:qvx"; |
139
|
125 |
1103
|
126 // Long options. See the comments in getopt.h for the meanings of the |
|
127 // fields in this structure. |
1613
|
128 #define EXEC_PATH_OPTION 1 |
|
129 #define INFO_FILE_OPTION 2 |
|
130 #define INFO_PROG_OPTION 3 |
2240
|
131 #define NO_INIT_FILE_OPTION 4 |
|
132 #define NO_LINE_EDITING_OPTION 5 |
|
133 #define NO_SITE_FILE_OPTION 6 |
|
134 #define TRADITIONAL_OPTION 7 |
1817
|
135 long_options long_opts[] = |
139
|
136 { |
1855
|
137 { "debug", prog_args::no_arg, 0, 'd' }, |
2277
|
138 { "braindead", prog_args::no_arg, 0, TRADITIONAL_OPTION }, |
1855
|
139 { "echo-commands", prog_args::no_arg, 0, 'x' }, |
|
140 { "exec-path", prog_args::required_arg, 0, EXEC_PATH_OPTION }, |
|
141 { "help", prog_args::no_arg, 0, 'h' }, |
|
142 { "info-file", prog_args::required_arg, 0, INFO_FILE_OPTION }, |
|
143 { "info-program", prog_args::required_arg, 0, INFO_PROG_OPTION }, |
|
144 { "interactive", prog_args::no_arg, 0, 'i' }, |
2239
|
145 { "no-init-file", prog_args::no_arg, 0, NO_INIT_FILE_OPTION }, |
1855
|
146 { "no-line-editing", prog_args::no_arg, 0, NO_LINE_EDITING_OPTION }, |
2239
|
147 { "no-site-file", prog_args::no_arg, 0, NO_SITE_FILE_OPTION }, |
1855
|
148 { "norc", prog_args::no_arg, 0, 'f' }, |
|
149 { "path", prog_args::required_arg, 0, 'p' }, |
|
150 { "quiet", prog_args::no_arg, 0, 'q' }, |
|
151 { "silent", prog_args::no_arg, 0, 'q' }, |
|
152 { "traditional", prog_args::no_arg, 0, TRADITIONAL_OPTION }, |
|
153 { "verbose", prog_args::no_arg, 0, 'V' }, |
|
154 { "version", prog_args::no_arg, 0, 'v' }, |
1103
|
155 { 0, 0, 0, 0 } |
139
|
156 }; |
1
|
157 |
1355
|
158 // Store the command-line options for later use. |
|
159 |
|
160 static void |
|
161 intern_argv (int argc, char **argv) |
|
162 { |
2926
|
163 octave_env::set_program_name (argv[0]); |
|
164 |
|
165 // XXX FIXME XXX -- Kpathsea needs this. |
|
166 |
|
167 #if ! defined (HAVE_PROGRAM_INVOCATION_NAME) |
|
168 program_invocation_name |
|
169 = strsave (octave_env::get_program_invocation_name () . c_str ()); |
|
170 |
|
171 program_invocation_short_name |
|
172 = strsave (octave_env::get_program_name () . c_str ()); |
|
173 #endif |
|
174 |
1355
|
175 if (argc > 1) |
|
176 { |
2495
|
177 // Skip program name in argv. |
1572
|
178 |
2495
|
179 octave_argv = string_vector (argv+1, argc-1); |
1411
|
180 |
|
181 bind_builtin_variable ("argv", octave_argv, 1, 1, 0); |
2404
|
182 bind_builtin_variable ("__argv__", octave_argv, 1, 1, 0); |
1355
|
183 } |
1907
|
184 |
2800
|
185 bind_builtin_variable ("nargin", static_cast<double> (argc-1), 1, 1, 0); |
1355
|
186 } |
|
187 |
1792
|
188 static void |
|
189 initialize_pathsearch (void) |
|
190 { |
|
191 // This may seem odd, but doing it this way means that we don't have |
|
192 // to modify the kpathsea library... |
|
193 |
2926
|
194 string odb = octave_env::getenv ("OCTAVE_DB_DIR"); |
1792
|
195 |
2926
|
196 if (odb.empty ()) |
1792
|
197 { |
2926
|
198 string oh = octave_env::getenv ("OCTAVE_HOME"); |
1792
|
199 |
2926
|
200 if (oh.empty ()) |
|
201 octave_env::putenv ("TEXMF", OCTAVE_DATADIR "/octave"); |
|
202 else |
1792
|
203 { |
2926
|
204 oh.append ("/lib/octave"); |
|
205 octave_env::putenv ("TEXMF", oh); |
1792
|
206 } |
|
207 } |
2926
|
208 else |
|
209 octave_env::putenv ("TEXMF", odb); |
1792
|
210 } |
|
211 |
581
|
212 // Initialize by reading startup files. |
|
213 |
1
|
214 static void |
|
215 execute_startup_files (void) |
|
216 { |
2985
|
217 unwind_protect::begin_frame ("execute_startup_files"); |
315
|
218 |
1651
|
219 // XXX FIXME XXX -- need to make it possible to set this in startup |
|
220 // files. |
1588
|
221 |
1651
|
222 unwind_protect_int (input_from_startup_file); |
|
223 |
|
224 input_from_startup_file = 1; |
315
|
225 |
793
|
226 int verbose = (verbose_flag && ! inhibit_startup_message); |
578
|
227 |
2239
|
228 if (read_site_files) |
1
|
229 { |
2239
|
230 // Execute commands from the site-wide configuration file. |
|
231 // First from the file $(prefix)/lib/octave/site/m/octaverc |
|
232 // (if it exists), then from the file |
|
233 // $(prefix)/lib/octave/$(version)/m/octaverc (if it exists). |
1755
|
234 |
2897
|
235 parse_and_execute (Vlocal_site_defaults_file, verbose); |
1755
|
236 |
2897
|
237 parse_and_execute (Vsite_defaults_file, verbose); |
1
|
238 } |
|
239 |
2239
|
240 if (read_init_files) |
|
241 { |
2512
|
242 // Try to execute commands from $HOME/$OCTAVE_INITFILE and |
|
243 // $OCTAVE_INITFILE. If $OCTAVE_INITFILE is not set, .octaverc |
|
244 // is assumed. |
2239
|
245 |
|
246 int home_rc_already_executed = 0; |
2512
|
247 |
2926
|
248 string initfile = octave_env::getenv ("OCTAVE_INITFILE"); |
2512
|
249 |
2926
|
250 if (initfile.empty ()) |
2512
|
251 initfile = ".octaverc"; |
|
252 |
2926
|
253 string home_dir = octave_env::get_home_directory (); |
|
254 |
|
255 string home_rc = home_dir + "/" + initfile; |
2512
|
256 string local_rc = string ("./") + initfile; |
2239
|
257 |
2926
|
258 if (! home_dir.empty ()) |
2239
|
259 { |
2897
|
260 parse_and_execute (home_rc, verbose); |
2239
|
261 |
|
262 // Names alone are not enough. |
|
263 |
|
264 file_stat fs_home_rc (home_rc); |
|
265 |
|
266 if (fs_home_rc) |
|
267 { |
2512
|
268 file_stat fs_dot_rc (local_rc); |
2239
|
269 |
|
270 if (fs_dot_rc && fs_home_rc.ino () == fs_dot_rc.ino ()) |
|
271 home_rc_already_executed = 1; |
|
272 } |
|
273 } |
|
274 |
|
275 if (! home_rc_already_executed) |
2897
|
276 parse_and_execute (local_rc, verbose); |
2239
|
277 } |
315
|
278 |
2985
|
279 unwind_protect::run_frame ("execute_startup_files"); |
1
|
280 } |
|
281 |
581
|
282 // Usage message with extra help. |
|
283 |
1
|
284 static void |
|
285 verbose_usage (void) |
|
286 { |
2375
|
287 cout << OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\ |
1613
|
288 \n\ |
|
289 Usage: octave [options]\n\ |
|
290 \n\ |
|
291 Options:\n\ |
1119
|
292 \n\ |
1613
|
293 -d, --debug Enter parser debugging mode.\n\ |
|
294 -x, --echo-commands Echo commands as they are executed.\n\ |
|
295 --exec-path PATH Set path for executing subprograms.\n\ |
|
296 -h, -?, --help Print short help message and exit.\n\ |
2239
|
297 -f, --norc Don't read any initialization files.\n\ |
1613
|
298 --info-file FILE Use top-level info file FILE.\n\ |
|
299 --info-program PROGRAM Use PROGRAM for reading info files.\n\ |
|
300 -i, --interactive Force interactive behavior.\n\ |
2470
|
301 --no-init-file Don't read the ~/.octaverc or .octaverc files.\n\ |
2212
|
302 --no-line-editing Don't use readline for command-line editing.\n\ |
2470
|
303 --no-site-file Don't read the site-wide octaverc file.\n\ |
1613
|
304 -p PATH, --path PATH Set initial LOADPATH to PATH.\n\ |
|
305 -q, --silent Don't print message at startup.\n\ |
|
306 --traditional Set compatibility variables.\n\ |
|
307 -V, --verbose Enable verbose output in some cases.\n\ |
|
308 -v, --version Print version number and exit.\n\ |
1119
|
309 \n\ |
1613
|
310 FILE Execute commands from FILE.\n\ |
2375
|
311 \n\ |
|
312 Additional information about Octave is available via the WWW at\n\ |
|
313 http://www.che.wisc.edu/octave.\n\ |
|
314 \n\ |
|
315 Please report bugs to the mailing list `bug-octave@bevo.che.wisc.edu'.\n"; |
285
|
316 |
613
|
317 exit (0); |
1
|
318 } |
|
319 |
581
|
320 // Terse usage messsage. |
|
321 |
1
|
322 static void |
|
323 usage (void) |
|
324 { |
613
|
325 cerr << "usage: " << usage_string << "\n"; |
1
|
326 exit (1); |
|
327 } |
|
328 |
|
329 static void |
|
330 print_version_and_exit (void) |
|
331 { |
1107
|
332 cout << OCTAVE_NAME_AND_VERSION << "\n"; |
1
|
333 exit (0); |
|
334 } |
|
335 |
721
|
336 static void |
|
337 initialize_error_handlers () |
|
338 { |
|
339 set_liboctave_error_handler (error); |
|
340 } |
|
341 |
1410
|
342 // What happens on --traditional. |
|
343 |
|
344 static void |
|
345 maximum_braindamage (void) |
|
346 { |
|
347 bind_builtin_variable ("PS1", ">> "); |
|
348 bind_builtin_variable ("PS2", ""); |
2402
|
349 bind_builtin_variable ("beep_on_error", 1.0); |
2993
|
350 bind_builtin_variable ("default_eval_print_flag", 0.0); |
1410
|
351 bind_builtin_variable ("default_save_format", "mat-binary"); |
2402
|
352 bind_builtin_variable ("define_all_return_values", 1.0); |
|
353 bind_builtin_variable ("do_fortran_indexing", 1.0); |
|
354 bind_builtin_variable ("empty_list_elements_ok", 1.0); |
|
355 bind_builtin_variable ("implicit_str_to_num_ok", 1.0); |
|
356 bind_builtin_variable ("ok_to_lose_imaginary_part", 1.0); |
|
357 bind_builtin_variable ("page_screen_output", 0.0); |
|
358 bind_builtin_variable ("prefer_column_vectors", 0.0); |
|
359 bind_builtin_variable ("print_empty_dimensions", 0.0); |
|
360 bind_builtin_variable ("treat_neg_dim_as_zero", 1.0); |
|
361 bind_builtin_variable ("warn_function_name_clash", 0.0); |
1410
|
362 bind_builtin_variable ("whitespace_in_literal_matrix", "traditional"); |
|
363 } |
|
364 |
581
|
365 // You guessed it. |
|
366 |
1
|
367 int |
|
368 main (int argc, char **argv) |
|
369 { |
2205
|
370 // The order of these calls is important. The call to |
2926
|
371 // install_defaults must come before install_builtins because |
2205
|
372 // default variable values must be available for the varaibles to be |
|
373 // installed, and the call to install_builtins must come before the |
|
374 // options are processed because some command line options override |
|
375 // defaults by calling bind_builtin_variable. |
721
|
376 |
1
|
377 sysdep_init (); |
|
378 |
721
|
379 initialize_error_handlers (); |
223
|
380 |
2926
|
381 install_defaults (); |
1
|
382 |
1792
|
383 initialize_pathsearch (); |
1744
|
384 |
2205
|
385 install_signal_handlers (); |
|
386 |
|
387 initialize_file_io (); |
|
388 |
2375
|
389 initialize_symbol_tables (); |
|
390 |
|
391 install_types (); |
|
392 |
|
393 install_ops (); |
2205
|
394 |
|
395 install_builtins (); |
|
396 |
1817
|
397 prog_args args (argc, argv, short_opts, long_opts); |
|
398 |
139
|
399 int optc; |
1817
|
400 while ((optc = args.getopt ()) != EOF) |
1
|
401 { |
139
|
402 switch (optc) |
1
|
403 { |
793
|
404 case 'V': |
2239
|
405 verbose_flag = true; |
793
|
406 break; |
|
407 |
1
|
408 case 'd': |
|
409 yydebug++; |
|
410 break; |
777
|
411 |
1
|
412 case 'f': |
2239
|
413 read_init_files = false; |
|
414 read_site_files = false; |
1
|
415 break; |
777
|
416 |
1
|
417 case 'h': |
|
418 case '?': |
|
419 verbose_usage (); |
|
420 break; |
777
|
421 |
1
|
422 case 'i': |
|
423 forced_interactive = 1; |
|
424 break; |
777
|
425 |
1
|
426 case 'p': |
1817
|
427 if (args.optarg ()) |
2205
|
428 bind_builtin_variable ("LOADPATH", args.optarg ()); |
1
|
429 break; |
777
|
430 |
1
|
431 case 'q': |
2239
|
432 inhibit_startup_message = true; |
1
|
433 break; |
777
|
434 |
1
|
435 case 'x': |
2205
|
436 { |
|
437 double tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE); |
|
438 bind_builtin_variable ("echo_executing_commands", tmp); |
|
439 } |
1
|
440 break; |
777
|
441 |
1
|
442 case 'v': |
|
443 print_version_and_exit (); |
|
444 break; |
777
|
445 |
1613
|
446 case EXEC_PATH_OPTION: |
1817
|
447 if (args.optarg ()) |
2205
|
448 bind_builtin_variable ("EXEC_PATH", args.optarg ()); |
1613
|
449 break; |
|
450 |
186
|
451 case INFO_FILE_OPTION: |
1817
|
452 if (args.optarg ()) |
2205
|
453 bind_builtin_variable ("INFO_FILE", args.optarg ()); |
186
|
454 break; |
777
|
455 |
1613
|
456 case INFO_PROG_OPTION: |
1817
|
457 if (args.optarg ()) |
2205
|
458 bind_builtin_variable ("INFO_PROGRAM", args.optarg ()); |
1613
|
459 break; |
|
460 |
2239
|
461 case NO_INIT_FILE_OPTION: |
|
462 read_init_files = false; |
|
463 break; |
|
464 |
1821
|
465 case NO_LINE_EDITING_OPTION: |
2926
|
466 line_editing = 0; |
2239
|
467 break; |
|
468 |
|
469 case NO_SITE_FILE_OPTION: |
|
470 read_site_files = 0; |
1821
|
471 break; |
|
472 |
1410
|
473 case TRADITIONAL_OPTION: |
2239
|
474 traditional = true; |
1410
|
475 break; |
|
476 |
1
|
477 default: |
|
478 usage (); |
|
479 break; |
|
480 } |
|
481 } |
|
482 |
1651
|
483 #if defined (HAVE_ATEXIT) || defined (HAVE_ON_EXIT) |
2077
|
484 // Make sure we clean up when we exit. Also allow users to register |
|
485 // functions. If we don't have atexit or on_exit, we're going to |
|
486 // leave some junk files around if we exit abnormally. |
|
487 |
|
488 atexit (do_octave_atexit); |
|
489 |
1
|
490 atexit (cleanup_tmp_files); |
318
|
491 #endif |
1
|
492 |
1358
|
493 // These can come after command line args since none of them set any |
|
494 // defaults that might be changed by command line options. |
581
|
495 |
2926
|
496 initialize_command_input (); |
315
|
497 |
578
|
498 if (! inhibit_startup_message) |
1106
|
499 cout << OCTAVE_STARTUP_MESSAGE "\n" << endl; |
578
|
500 |
1410
|
501 if (traditional) |
|
502 maximum_braindamage (); |
|
503 |
2239
|
504 execute_startup_files (); |
1651
|
505 |
2926
|
506 command_history::read (false); |
1
|
507 |
578
|
508 if (! inhibit_startup_message && reading_startup_message_printed) |
|
509 cout << endl; |
|
510 |
1358
|
511 // Avoid counting commands executed from startup files. |
|
512 |
2926
|
513 command_editor::reset_current_command_number (1); |
1
|
514 |
1358
|
515 // If there is an extra argument, see if it names a file to read. |
|
516 // Additional arguments are taken as command line options for the |
|
517 // script. |
1
|
518 |
1817
|
519 int last_arg_idx = args.optind (); |
|
520 int remaining_args = argc - last_arg_idx; |
1355
|
521 if (remaining_args > 0) |
149
|
522 { |
984
|
523 reading_script_file = 1; |
1817
|
524 curr_fcn_file_name = argv[last_arg_idx]; |
1608
|
525 curr_fcn_file_full_name = curr_fcn_file_name; |
1411
|
526 |
984
|
527 FILE *infile = get_input_from_file (curr_fcn_file_name); |
1411
|
528 |
529
|
529 if (infile) |
287
|
530 { |
1516
|
531 input_from_command_line_file = 1; |
|
532 |
1411
|
533 bind_builtin_variable ("program_invocation_name", |
|
534 curr_fcn_file_name); |
|
535 |
1755
|
536 size_t pos = curr_fcn_file_name.rfind ('/'); |
|
537 |
|
538 string tmp = (pos != NPOS) |
|
539 ? curr_fcn_file_name.substr (pos+1) : curr_fcn_file_name; |
1411
|
540 |
|
541 bind_builtin_variable ("program_name", tmp); |
|
542 |
1817
|
543 intern_argv (remaining_args, argv+last_arg_idx); |
1411
|
544 |
2926
|
545 command_editor::blink_matching_paren (false); |
|
546 |
287
|
547 switch_to_buffer (create_buffer (infile)); |
|
548 } |
529
|
549 else |
|
550 clean_up_and_exit (1); |
1
|
551 } |
|
552 else |
|
553 { |
1355
|
554 // Is input coming from a terminal? If so, we are probably |
|
555 // interactive. |
1
|
556 |
|
557 interactive = (isatty (fileno (stdin)) && isatty (fileno (stdout))); |
1355
|
558 |
|
559 intern_argv (argc, argv); |
|
560 |
|
561 switch_to_buffer (create_buffer (get_input_from_stdin ())); |
1
|
562 } |
|
563 |
1358
|
564 // Force input to be echoed if not really interactive, but the user |
|
565 // has forced interactive behavior. |
1
|
566 |
1907
|
567 if (! interactive && forced_interactive) |
287
|
568 { |
2926
|
569 command_editor::blink_matching_paren (false); |
1588
|
570 |
|
571 // XXX FIXME XXX -- is this the right thing to do? |
|
572 |
|
573 bind_builtin_variable ("echo_executing_commands", |
2800
|
574 static_cast<double> (ECHO_CMD_LINE)); |
287
|
575 } |
1
|
576 |
1410
|
577 if (! interactive) |
2926
|
578 line_editing = 0; |
1
|
579 |
1907
|
580 int retval = main_loop (); |
1
|
581 |
1005
|
582 if (retval == 1 && ! error_state) |
|
583 retval = 0; |
|
584 |
1
|
585 clean_up_and_exit (retval); |
|
586 } |
|
587 |
560
|
588 /* |
1
|
589 ;;; Local Variables: *** |
|
590 ;;; mode: C++ *** |
|
591 ;;; End: *** |
|
592 */ |