]> diplodocus.org Git - nmh/blobdiff - uip/fmtdump.c
fdcompare.c: Move interface to own file.
[nmh] / uip / fmtdump.c
index 3fa0876af479bb41051768bb0fc820b486c6a69c..b7c48120e5122cfe33ee7bcb5cc78e0357ac78db 100644 (file)
@@ -5,12 +5,16 @@
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/fmt_scan.h>
-#include <h/fmt_compile.h>
-#include <h/scansbr.h>
+#include "h/mh.h"
+#include "sbr/ambigsw.h"
+#include "sbr/print_version.h"
+#include "sbr/print_help.h"
+#include "sbr/error.h"
+#include "h/fmt_scan.h"
+#include "h/fmt_compile.h"
+#include "h/scansbr.h"
 #include "h/done.h"
-#include <h/utils.h>
+#include "h/utils.h"
 
 #define FMTDUMP_SWITCHES \
     X("form formatfile", 0, FORMSW) \
@@ -51,7 +55,7 @@ main (int argc, char **argv)
     char buf[BUFSIZ], *nfs, **argp, **arguments;
     struct format *fmt;
 
-    if (nmh_init(argv[0], 2)) { return 1; }
+    if (nmh_init(argv[0], true, false)) { return 1; }
 
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
@@ -63,7 +67,7 @@ main (int argc, char **argv)
                    ambigsw (cp, switches);
                    done (1);
                case UNKWNSW: 
-                   adios (NULL, "-%s unknown", cp);
+                   die("-%s unknown", cp);
 
                case HELPSW: 
                    snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
@@ -75,19 +79,19 @@ main (int argc, char **argv)
 
                case FORMSW: 
                    if (!(form = *argp++) || *form == '-')
-                       adios (NULL, "missing argument to %s", argp[-2]);
+                       die("missing argument to %s", argp[-2]);
                    format = NULL;
                    continue;
                case FMTSW: 
                    if (!(format = *argp++) || *format == '-')
-                       adios (NULL, "missing argument to %s", argp[-2]);
+                       die("missing argument to %s", argp[-2]);
                    form = NULL;
                    continue;
 
            }
        }
        if (form)
-           adios (NULL, "only one form at a time!");
+           die("only one form at a time!");
         form = cp;
     }