X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fap.c;h=a74eb961c9240b9e0c1b670b4f4f0bfdd1c19692;hb=d254c5e2ad008f26d5fda43c3f24f0a711c7e851;hp=623e0030ac3f0ac143d2c1adb4dd3f9e1917b212;hpb=43ea5347b6b445d926082d6e3c1ddec376e8692d;p=mmh diff --git a/uip/ap.c b/uip/ap.c index 623e003..a74eb96 100644 --- a/uip/ap.c +++ b/uip/ap.c @@ -9,6 +9,7 @@ #include #include #include +#include #define NADDRS 100 @@ -20,9 +21,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 } @@ -47,9 +48,7 @@ main(int argc, char **argv) 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 +62,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 +71,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 == '-') @@ -114,7 +114,7 @@ main(int argc, char **argv) for (addrp = 0; addrs[addrp]; addrp++) status += process(addrs[addrp], normalize); - done(status); + exit(status); return 1; }