X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fap.c;h=41554d7ed14c231fb25f2c4ca8327ab9c0d18e37;hp=aaa87629d947309ce8fe7a1154973cda1017fa77;hb=fede6e42d81ce34fd5c1bbe7fb2757b281c2573a;hpb=0073224c28bf81dad1812d406bb9915b24b23eb6 diff --git a/uip/ap.c b/uip/ap.c index aaa8762..41554d7 100644 --- a/uip/ap.c +++ b/uip/ap.c @@ -20,9 +20,9 @@ static struct swit switches[] = { #define NORMSW 1 { "normalize", 0 }, #define NNORMSW 2 - { "nonormalize", 0 }, + { "nonormalize", 2 }, #define VERSIONSW 3 - { "version", 0 }, + { "Version", 0 }, #define HELPSW 4 { "help", 0 }, { NULL, 0 } @@ -43,13 +43,11 @@ main(int argc, char **argv) { int addrp = 0, normalize = AD_HOST; int status = 0; - char *cp, *form = NULL, *nfs; + char *cp, *form = NULL, *fmtstr; char buf[BUFSIZ], **argp; char **arguments, *addrs[NADDRS]; -#ifdef LOCALE setlocale(LC_ALL, ""); -#endif invo_name = mhbasename(argv[0]); /* read user profile/context */ @@ -63,7 +61,8 @@ main(int argc, char **argv) switch (smatch(++cp, switches)) { case AMBIGSW: ambigsw(cp, switches); - done(1); + /* sysexits.h EX_USAGE */ + exit(1); case UNKWNSW: adios(NULL, "-%s unknown", cp); @@ -71,10 +70,10 @@ main(int argc, char **argv) case HELPSW: snprintf(buf, sizeof(buf), "%s [switches] addrs ...", invo_name); print_help(buf, switches, 1); - done(1); + exit(0); case VERSIONSW: print_version(invo_name); - done(1); + exit(0); case FORMSW: if (!(form = *argp++) || *form == '-') @@ -100,10 +99,10 @@ main(int argc, char **argv) adios(NULL, "usage: %s [switches] addrs ...", invo_name); /* get new format string */ - nfs = new_fs(form, FORMAT); + fmtstr = new_fs(form, FORMAT); fmt_norm = normalize; - fmt_compile(nfs, &fmt); + fmt_compile(fmtstr, &fmt); dat[0] = 0; dat[1] = 0; @@ -114,7 +113,7 @@ main(int argc, char **argv) for (addrp = 0; addrs[addrp]; addrp++) status += process(addrs[addrp], normalize); - done(status); + exit(status); return 1; }