X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fanno.c;h=5de385f02a8265b356b2c5f95904f07f99289d93;hp=1d27a9e9586e09d29cf3f54385bfbc919fb100f6;hb=5b792c4424571f05bc2008e3109797d18d7d00d1;hpb=8e5be81f784682822f5e868c1bf3c8624682bd23 diff --git a/uip/anno.c b/uip/anno.c index 1d27a9e..5de385f 100644 --- a/uip/anno.c +++ b/uip/anno.c @@ -110,88 +110,91 @@ main(int argc, char **argv) while ((cp = *argp++)) { if (*cp == '-') { switch (smatch(++cp, switches)) { - case AMBIGSW: - ambigsw(cp, switches); - done(1); - case UNKWNSW: - adios(NULL, "-%s unknown", cp); - - case HELPSW: - snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", - invo_name); - print_help(buf, switches, 1); - done(1); - case VERSIONSW: - print_version(invo_name); - done(1); - - case COMPSW: - if (comp) - adios(NULL, "only one component at a time!"); - if (!(comp = *argp++) || *comp == '-') + case AMBIGSW: + ambigsw(cp, switches); + done(1); + case UNKWNSW: + adios(NULL, "-%s unknown", cp); + + case HELPSW: + snprintf(buf, sizeof(buf), + "%s [+folder] [msgs] [switches]", + invo_name); + print_help(buf, switches, 1); + done(1); + case VERSIONSW: + print_version(invo_name); + done(1); + + case COMPSW: + if (comp) + adios(NULL, "only one component at a time!"); + if (!(comp = *argp++) || *comp == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case DATESW: + datesw++; + continue; + case NDATESW: + datesw = 0; + continue; + + case INPLSW: + inplace++; + continue; + case NINPLSW: + inplace = 0; + continue; + + case TEXTSW: + if (text) + adios(NULL, "only one body at a time!"); + if (!(text = *argp++) || *text == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case DELETESW: /* delete annotations */ + delete = 0; + continue; + + case LISTSW: /* produce a listing */ + list = 1; + continue; + + case NUMBERSW: /* number listing or delete by number */ + if (number != 0) + adios(NULL, "only one number at a time!"); + + if (argp-arguments == argc-1 || **argp == '-') + number = 1; + + else { + if (strcmp(*argp, "all") == 0) + number = -1; + + else if (!(number = atoi(*argp))) adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case DATESW: - datesw++; - continue; - case NDATESW: - datesw = 0; - continue; - - case INPLSW: - inplace++; - continue; - case NINPLSW: - inplace = 0; - continue; - - case TEXTSW: - if (text) - adios(NULL, "only one body at a time!"); - if (!(text = *argp++) || *text == '-') - adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case DELETESW: /* delete annotations */ - delete = 0; - continue; - - case LISTSW: /* produce a listing */ - list = 1; - continue; - - case NUMBERSW: /* number listing or delete by number */ - if (number != 0) - adios(NULL, "only one number at a time!"); - - if (argp - arguments == argc - 1 || **argp == '-') - number = 1; - - else { - if (strcmp(*argp, "all") == 0) - number = -1; - - else if (!(number = atoi(*argp))) - adios(NULL, "missing argument to %s", argp[-2]); - argp++; - } + argp++; + } - delete = number; - continue; + delete = number; + continue; - case APPENDSW: /* append annotations instead of default prepend */ - append = 1; - continue; + case APPENDSW: /* append annotations instead of default prepend */ + append = 1; + continue; - case PRESERVESW: /* preserve access and modification times on annotated message */ - annopreserve(1); - continue; + case PRESERVESW: /* preserve access and modification times on annotated message */ + annopreserve(1); + continue; - case NOPRESERVESW: /* don't preserve access and modification times on annotated message (default) */ - annopreserve(0); - continue; + case NOPRESERVESW: /* don't preserve access and modification times on annotated message (default) */ + annopreserve(0); + continue; } } if (*cp == '+' || *cp == '@') {