X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fterminal%2Fcommand-line.c;h=95b22cebf8bea93995e87833ed3fec52bf64f044;hb=5ee84736663824fe12474b78dace867e42893a14;hp=eb7d99fa264da30e161644ff35c5bc0a5f9d33fd;hpb=b1d443d69154707ed834fccff17a54585c84507d;p=pspp-builds.git diff --git a/src/ui/terminal/command-line.c b/src/ui/terminal/command-line.c index eb7d99fa..95b22ceb 100644 --- a/src/ui/terminal/command-line.c +++ b/src/ui/terminal/command-line.c @@ -1,21 +1,18 @@ -/* PSPP - computes sample statistics. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . +/* PSPP - a program for statistical analysis. + Copyright (C) 1997-9, 2000, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ #include #include "command-line.h" @@ -26,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -41,16 +37,14 @@ #include #include "read-line.h" +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid -void welcome (void); static void usage (void); -char *subst_vars (char *); - - /* Parses the command line specified by ARGC and ARGV as received by main(). Returns true if normal execution should proceed, false if the command-line indicates that PSPP should exit. */ @@ -102,9 +96,9 @@ parse_command_line (int argc, char **argv, struct source_stream *ss) /* Compatibility options */ case 'a': if ( 0 == strcmp(optarg,"compatible") ) - set_algorithm(COMPATIBLE); + settings_set_algorithm(COMPATIBLE); else if ( 0 == strcmp(optarg,"enhanced")) - set_algorithm(ENHANCED); + settings_set_algorithm(ENHANCED); else { usage (); @@ -112,11 +106,11 @@ parse_command_line (int argc, char **argv, struct source_stream *ss) } break; - case 'x': + case 'x': if ( 0 == strcmp(optarg,"compatible") ) - set_syntax(COMPATIBLE); + settings_set_syntax (COMPATIBLE); else if ( 0 == strcmp(optarg,"enhanced")) - set_syntax(ENHANCED); + settings_set_syntax (ENHANCED); else { usage (); @@ -168,7 +162,7 @@ parse_command_line (int argc, char **argv, struct source_stream *ss) process_statrc = false; break; case 's': - set_safer_mode (); + settings_set_safer_mode (); break; case 'v': verbose_increment_level (); @@ -178,8 +172,7 @@ parse_command_line (int argc, char **argv, struct source_stream *ss) puts (legal); return false; case 'T': - force_long_view (); - set_testing_mode (true); + settings_set_testing_mode (true); break; case '?': usage (); @@ -194,25 +187,40 @@ parse_command_line (int argc, char **argv, struct source_stream *ss) if (process_statrc) { char *pspprc_fn = fn_search_path ("rc", config_path); - if (pspprc_fn != NULL) + if (pspprc_fn != NULL) { - getl_append_source (ss, create_syntax_file_source (pspprc_fn)); + getl_append_source (ss, + create_syntax_file_source (pspprc_fn), + GETL_BATCH, + ERRMODE_CONTINUE + ); - free (pspprc_fn); + free (pspprc_fn); } } for (i = optind; i < argc; i++) if (strchr (argv[i], '=')) outp_configure_macro (argv[i]); - else + else { - getl_append_source (ss, create_syntax_file_source (argv[i])); + getl_append_source (ss, + create_syntax_file_source (argv[i]), + GETL_BATCH, + ERRMODE_CONTINUE + ); syntax_files++; } if (!syntax_files || interactive_mode) - getl_append_source (ss, create_readln_source () ); + { + getl_append_source (ss, create_readln_source (), + GETL_INTERACTIVE, + ERRMODE_CONTINUE + ); + if (!cleared_device_defaults) + outp_configure_add ("interactive"); + } return true; }