X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fdp.c;h=66f0f42bfc0f720aa4a024aea4a66985ed73f059;hp=a5accf53f19031c9b68f8b48ac753221155f8fc2;hb=27826f9353e0f0b04590b7d0f8f83e60462b90f0;hpb=240013872c392fe644bd4f79382d9f5314b4ea60 diff --git a/uip/dp.c b/uip/dp.c index a5accf5..66f0f42 100644 --- a/uip/dp.c +++ b/uip/dp.c @@ -15,18 +15,16 @@ #define WIDTH 78 #define WBUFSIZ BUFSIZ -#define FORMAT "%<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%>" +#define FORMAT "=%<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%>" static struct swit switches[] = { #define FORMSW 0 { "form formatfile", 0 }, -#define FMTSW 1 - { "format string", 5 }, -#define WIDTHSW 2 +#define WIDTHSW 1 { "width columns", 0 }, -#define VERSIONSW 3 +#define VERSIONSW 2 { "version", 0 }, -#define HELPSW 4 +#define HELPSW 3 { "help", 0 }, { NULL, 0 } }; @@ -50,7 +48,7 @@ int main(int argc, char **argv) { int datep = 0, width = 0, status = 0; - char *cp, *form = NULL, *format = NULL, *nfs; + char *cp, *form = NULL, *nfs; char buf[BUFSIZ], **argp, **arguments; char *dates[NDATES]; @@ -68,36 +66,32 @@ 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 [switches] dates ...", invo_name); - print_help(buf, switches, 1); - done(1); - case VERSIONSW: - print_version(invo_name); - done(1); - - case FORMSW: - if (!(form = *argp++) || *form == '-') - adios(NULL, "missing argument to %s", argp[-2]); - format = NULL; - continue; - case FMTSW: - if (!(format = *argp++) || *format == '-') - adios(NULL, "missing argument to %s", argp[-2]); - form = NULL; - continue; - - case WIDTHSW: - if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); - width = atoi(cp); - continue; + case AMBIGSW: + ambigsw(cp, switches); + done(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); + case VERSIONSW: + print_version(invo_name); + done(1); + + case FORMSW: + if (!(form = *argp++) || *form == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case WIDTHSW: + if (!(cp = *argp++) || *cp == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + width = atoi(cp); + continue; } } if (datep > NDATES) @@ -111,7 +105,7 @@ main(int argc, char **argv) adios(NULL, "usage: %s [switches] dates ...", invo_name); /* get new format string */ - nfs = new_fs(form, format, FORMAT); + nfs = new_fs(form, FORMAT); if (width == 0) { if ((width = sc_width()) < WIDTH / 2)