X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fcomp.c;h=62e4cd2216c01865f00ccff84c744c1bce998055;hb=2abb9a7cfb0930e27062088734d306e7d78e4cc2;hp=cbe24d86c18e75a0f212128701b1e1dbe4655b73;hpb=ee4f43cf2ef0084ec698e4e87159a94c01940622;p=mmh diff --git a/uip/comp.c b/uip/comp.c index cbe24d8..62e4cd2 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -9,23 +9,23 @@ #include #include #include +#include +#include static struct swit switches[] = { #define EDITRSW 0 { "editor editor", 0 }, -#define NEDITSW 1 - { "noedit", 0 }, -#define FORMSW 2 +#define FORMSW 1 { "form formfile", 0 }, -#define USESW 3 +#define USESW 2 { "use", 0 }, -#define NUSESW 4 - { "nouse", 0 }, -#define WHATSW 5 +#define NUSESW 3 + { "nouse", 2 }, +#define WHATSW 4 { "whatnowproc program", 0 }, -#define VERSIONSW 6 - { "version", 0 }, -#define HELPSW 7 +#define VERSIONSW 5 + { "Version", 0 }, +#define HELPSW 6 { "help", 0 }, { NULL, 0 } }; @@ -34,7 +34,7 @@ static struct swit switches[] = { int main(int argc, char **argv) { - int use = NOUSE, nedit = 0; + int use = NOUSE; int in, out; char *cp, *cwd, *maildir; char *ed = NULL, *form = NULL; @@ -43,10 +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 */ @@ -60,25 +57,22 @@ 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 EDITRSW: if (!(ed = *argp++) || *ed == '-') adios(NULL, "missing argument to %s", argp[-2]); - nedit = 0; - continue; - case NEDITSW: - nedit++; continue; case WHATSW: @@ -141,7 +135,8 @@ main(int argc, char **argv) adios(NULL, "no messages in %s", folder); /* 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); /* set the previous-sequence */ if (mp->numsel > 1) adios(NULL, "only one message at a time!"); @@ -170,7 +165,7 @@ main(int argc, char **argv) } context_save(); - what_now(ed, nedit, use, drft, NULL, 0, NULLMP, NULL, cwd); - done(1); + what_now(ed, use, drft, NULL, 0, NULLMP, NULL, cwd); + /* sysexits.h EX_SOFTWARE */ return 1; }