From: Joey Schulze Date: Mon, 22 Nov 2004 08:46:13 +0000 (+0000) Subject: Added preliminary support for -r to emit raw output without X-Git-Tag: upstream_newmail_0-3~14 X-Git-Url: https://git.infodrom.org/?p=infodrom%2Fnewmail;a=commitdiff_plain;h=9ab5bfeccfa52aa8ed2268afb9f05c5ed50094d2 Added preliminary support for -r to emit raw output without potentially broken character conversion, which may be useful for programs post-processing the output, i.e. in a window. --- diff --git a/newmail.c b/newmail.c index cfa574e..0ba53bb 100644 --- a/newmail.c +++ b/newmail.c @@ -28,9 +28,10 @@ void usage() printf("%s %s -- %s\n", PROGNAME, VERSION, COPYRIGHT); printf("\n%s [options] [mailbox [mailbox [..]]]\n", PROGNAME); - printf("-w Run as window application in foreground\n"); printf("-b Ring a bell when a new set of mails arrived\n"); printf("-i Interval between checking the mailbox(es)\n"); + printf("-r Raw output, i.e. no character conversion\n"); + printf("-w Run as window application in foreground\n"); } int main(int argc, char *argv[]) @@ -38,10 +39,11 @@ int main(int argc, char *argv[]) int opt_bell = 0; unsigned int opt_interval = 60; int opt_window = 0; + int opt_raw = 0; int c; int tmp_i; - while ((c = getopt(argc, argv, "bhi:w")) != -1) { + while ((c = getopt(argc, argv, "bhi:rw")) != -1) { switch (c) { case 'b': opt_bell = 1; @@ -56,6 +58,9 @@ int main(int argc, char *argv[]) else fprintf(stderr, "Interval not greater as zero, ignoring\n"); break; + case 'r': + opt_raw = 1; + break; case 'w': opt_window = 1; break;