/* Made conformant to the GNU coding standards January, 1995
by Francesco Potorti` <pot@cnuce.cnr.it>. */
-#include <stdio.h>
-#include <time.h>
-#include <sys/types.h>
-#ifdef MSDOS
-#include <fcntl.h>
-#endif
-
#ifdef HAVE_CONFIG_H
#include <config.h>
/* On some systems, Emacs defines static as nothing for the sake
#undef static
#endif
+#include <stdio.h>
+#include <time.h>
+#include <sys/types.h>
+#include <getopt.h>
+#ifdef MSDOS
+#include <fcntl.h>
+#endif
+
#undef TRUE
#define TRUE 1
#undef FALSE
char *progname;
+struct option longopts[] =
+{
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'V' },
+ { 0 }
+};
+
+extern int optind;
+
+int
main (argc, argv)
int argc;
char **argv;
#endif
progname = argv[0];
- if (argc != 1)
+ while (1)
+ {
+ int opt = getopt_long (argc, argv, "hV", longopts, 0);
+ if (opt == EOF)
+ break;
+
+ switch (opt)
+ {
+ case 'V':
+ printf ("%s (GNU Emacs %s)\n", "b2m", VERSION);
+ puts ("b2m is in the public domain.");
+ exit (GOOD);
+
+ case 'h':
+ fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname);
+ exit (GOOD);
+ }
+ }
+
+ if (optind != argc)
{
fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname);
exit (GOOD);
}
+
labels_saved = printing = header = FALSE;
ltoday = time (0);
today = ctime (<oday);
void
fatal (message)
+ char *message;
{
fprintf (stderr, "%s: %s\n", progname, message);
exit (BAD);