X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/eed1bea439a5e3c62958fa1e524d527c4a2fb85d..0b7286788a95dd854d1826b8493eda431d8e8aac:/uip/fmtdump.c diff --git a/uip/fmtdump.c b/uip/fmtdump.c index 3fa0876a..b7c48120 100644 --- a/uip/fmtdump.c +++ b/uip/fmtdump.c @@ -5,12 +5,16 @@ * complete copyright information. */ -#include -#include -#include -#include +#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 +#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; }