Make the expression code a little nicer and fix bugs found
[pspp] / src / cmdline.c
index a1a5281c3fb89819f363a99e0273c9a0202232b1..b72f545ba211107888c953ac05e3e92b64c97616 100644 (file)
@@ -18,7 +18,8 @@
    02111-1307, USA. */
 
 #include <config.h>
-#include <assert.h>
+#include "cmdline.h"
+#include "error.h"
 #include <ctype.h>
 #include <stdio.h>
 #include <errno.h>
@@ -40,6 +41,8 @@ static void usage (void);
 
 char *subst_vars (char *);
 
+static int testing_mode=0;
+
 /* Parses the command line specified by ARGC and ARGV as received by
    main(). */
 void
@@ -63,7 +66,7 @@ parse_command_line (int argc, char **argv)
     {"pipe", no_argument, NULL, 'p'},
     {"recon", no_argument, NULL, 'n'},
     {"safer", no_argument, NULL, 's'},
-    {"testing-mode", no_argument, &set_testing_mode, 1},
+    {"testing-mode", no_argument, &testing_mode, 1},
     {"verbose", no_argument, NULL, 'v'},
     {"version", no_argument, NULL, 'V'},
     {0, 0, 0, 0},
@@ -108,7 +111,8 @@ parse_command_line (int argc, char **argv)
          config_path = optarg;
          break;
        case 'f':
-         printf (_("-f not yet implemented\n"));
+         printf(_("%s is not yet implemented."), "-f");
+          putchar('\n');
          break;
        case 'h':
          usage ();
@@ -126,7 +130,8 @@ parse_command_line (int argc, char **argv)
          outp_list_classes ();
          err_hcf (1);
        case 'n':
-         printf (_("-n not yet implemented\n"));
+         printf (_("%s is not yet implemented."),"-n");
+          putchar('\n');
          break;
        case 'o':
          if (!cleared_device_defaults)
@@ -137,13 +142,14 @@ parse_command_line (int argc, char **argv)
          outp_configure_add (optarg);
          break;
        case 'p':
-         printf (_("-p not yet implemented\n"));
+         printf (_("%s is not yet implemented."),"-p");
+          putchar('\n');
          break;
        case 'r':
          no_statrc = 1;
          break;
        case 's':
-         set_safer = 1;
+         make_safe();
          break;
        case 'v':
          err_verbosity++;
@@ -168,11 +174,13 @@ parse_command_line (int argc, char **argv)
        }
     }
 
-  if (set_testing_mode)
+
+  if (testing_mode)
     {
       /* FIXME: Later this option should do some other things, too. */
-      set_viewwidth = 9999;
+      force_long_view();
     }
+    
 
   for (i = optind; i < argc; i++)
     {