]> andersk Git - moira.git/commitdiff
Don't dump core if we're not given a file name on the command line,
authorzacheiss <zacheiss>
Thu, 27 Jul 2000 01:08:32 +0000 (01:08 +0000)
committerzacheiss <zacheiss>
Thu, 27 Jul 2000 01:08:32 +0000 (01:08 +0000)
don't allow users to specify more than one file, and update the usage
message to remove options that no longer exist.

regtape/staff.pc
regtape/student.pc

index 41cb8176ccf4f475e298d974ac01443ea132fa1a..a636b2f17989b70e16873dab6c1ab18443d15c89 100644 (file)
@@ -81,11 +81,20 @@ int main(int argc, char **argv)
       if (!strcmp(argv[i], "-w"))
        wait++;
       else if (file)
-       fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami);
+       {
+         fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami);
+         exit(1);
+       }
       else
        file = argv[i];
     }
 
+  if (!file)
+    {
+      fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami);
+      exit(1);
+    }
+
   in = fopen(file, "r");
   if (!in)
     {
index 39469954cb77f6750080b6fb2829dbdfb7652787..2a673c7e9ac17b706287425cddadcfcf6cf801ec 100644 (file)
@@ -101,12 +101,21 @@ int main(int argc, char **argv)
     {
       if (!strcmp(argv[i], "-w"))
        wait++;
-      else if (file)
-       fprintf(stderr, "Usage: %s [-w] [-D] [-n] inputfile\n", whoami);
+      if (file)
+       {
+         fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami);
+         exit(1);
+       }
       else
        file = argv[i];
     }
 
+  if (!file)
+    {
+      fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami);
+      exit(1);
+    }
+
   in = fopen(file, "r");
   if (!in)
     {
This page took 0.356397 seconds and 5 git commands to generate.