X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fdp.c;h=22e725c30cfb0c2a4515c0edc837d5fd16883311;hp=d64a0b9e5c625e92718727ceaa685979ce37e48e;hb=fede6e42d81ce34fd5c1bbe7fb2757b281c2573a;hpb=43ea5347b6b445d926082d6e3c1ddec376e8692d diff --git a/uip/dp.c b/uip/dp.c index d64a0b9..22e725c 100644 --- a/uip/dp.c +++ b/uip/dp.c @@ -18,7 +18,7 @@ static struct swit switches[] = { #define FORMSW 0 { "form formatfile", 0 }, #define VERSIONSW 1 - { "version", 0 }, + { "Version", 0 }, #define HELPSW 2 { "help", 0 }, { NULL, 0 } @@ -42,9 +42,7 @@ main(int argc, char **argv) char buf[BUFSIZ], **argp, **arguments; char *dates[NDATES]; -#ifdef LOCALE setlocale(LC_ALL, ""); -#endif invo_name = mhbasename(argv[0]); /* read user profile/context */ @@ -58,17 +56,18 @@ 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); case HELPSW: snprintf(buf, sizeof(buf), "%s [switches] dates ...", 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 == '-') @@ -103,8 +102,7 @@ main(int argc, char **argv) status += process(dates[datep]); context_save(); /* save the context file */ - done(status); - return 1; + return status; }