Implemented the INSERT command.
[pspp-builds.git] / src / ui / terminal / command-line.c
index 39e015050e1fc0731eed7fd86cc0d90eee8575d0..1205d4d5a4954d05cdcbae134af38970caaa987c 100644 (file)
@@ -1,20 +1,18 @@
-/* PSPP - computes sample statistics.
-   Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+/* 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 <http://www.gnu.org/licenses/>. */
 
 #include <config.h>
 #include "command-line.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. */
@@ -195,7 +189,11 @@ parse_command_line (int argc, char **argv, struct source_stream *ss)
       char *pspprc_fn = fn_search_path ("rc", config_path);
       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);
         }
@@ -206,12 +204,23 @@ parse_command_line (int argc, char **argv, struct source_stream *ss)
       outp_configure_macro (argv[i]);
     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;
 }