Added preliminary support for -r to emit raw output without
authorJoey Schulze <joey@infodrom.org>
Mon, 22 Nov 2004 08:46:13 +0000 (08:46 +0000)
committerJoey Schulze <joey@infodrom.org>
Mon, 22 Nov 2004 08:46:13 +0000 (08:46 +0000)
potentially broken character conversion, which may be useful for
programs post-processing the output, i.e. in a window.

newmail.c

index cfa574e..0ba53bb 100644 (file)
--- 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 <n>  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;