X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fdist.c;h=21c67028f30a7303fa35232ef08d3fc80075c837;hp=dabfec75a7dd15bd51f6f1d8f032f2e35eeed052;hb=2abb9a7cfb0930e27062088734d306e7d78e4cc2;hpb=d5b5e6e4813b7fd77dc1664df4304537f3002cf3 diff --git a/uip/dist.c b/uip/dist.c index dabfec7..21c6702 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -9,25 +9,23 @@ #include #include #include +#include +#include static struct swit switches[] = { #define ANNOSW 0 { "annotate", 0 }, #define NANNOSW 1 - { "noannotate", 0 }, + { "noannotate", 2 }, #define EDITRSW 2 { "editor editor", 0 }, -#define NEDITSW 3 - { "noedit", 0 }, -#define FORMSW 4 +#define FORMSW 3 { "form formfile", 0 }, -#define WHATSW 5 +#define WHATSW 4 { "whatnowproc program", 0 }, -#define NWHATSW 6 - { "nowhatnowproc", 0 }, -#define VERSIONSW 7 - { "version", 0 }, -#define HELPSW 8 +#define VERSIONSW 5 + { "Version", 0 }, +#define HELPSW 6 { "help", 0 }, { NULL, 0 } }; @@ -36,8 +34,8 @@ static struct swit switches[] = { int main(int argc, char **argv) { - int anot = 0, nedit = 0; - int nwhat = 0, in, out; + int anot = 0; + int in, out; char *cp, *cwd, *maildir, *msgnam; char *ed = NULL, *folder = NULL; char *form = NULL, *msg = NULL, buf[BUFSIZ], drft[BUFSIZ]; @@ -45,9 +43,7 @@ main(int argc, char **argv) struct msgs *mp = NULL; char *fmtstr; -#ifdef LOCALE setlocale(LC_ALL, ""); -#endif invo_name = mhbasename(argv[0]); /* read user profile/context */ @@ -61,17 +57,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 [+folder] [msg] [switches]", invo_name); print_help(buf, switches, 1); - done(1); + exit(0); case VERSIONSW: print_version(invo_name); - done(1); + exit(0); case ANNOSW: anot++; @@ -84,20 +81,12 @@ main(int argc, char **argv) if (!(ed = *argp++) || *ed == '-') adios(NULL, "missing argument to %s", argp[-2]); - nedit = 0; - continue; - case NEDITSW: - nedit++; continue; case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') adios(NULL, "missing argument to %s", argp[-2]); - nwhat = 0; - continue; - case NWHATSW: - nwhat++; continue; case FORMSW: @@ -150,7 +139,8 @@ main(int argc, char **argv) /* parse the message range/sequence/name and set SELECTED */ if (!m_convert(mp, msg)) - done(1); + /* sysexits.h EX_USAGE*/ + exit(1); seq_setprev(mp); if (mp->numsel > 1) @@ -165,10 +155,7 @@ main(int argc, char **argv) seq_save(mp); /* synchronize sequences */ context_save(); - if (nwhat) - done(0); - what_now(ed, nedit, NOUSE, drft, msgnam, 1, mp, - anot ? "Resent" : NULL, cwd); - done(1); + what_now(ed, NOUSE, drft, msgnam, 1, mp, anot ? "Resent" : NULL, cwd); + /*sysexits.h EX_SOFTWARE*/ return 1; }