*** main.c.orig Fri Feb 4 11:02:57 2000 --- main.c Fri Feb 4 11:34:53 2000 *************** *** 27,33 **** #include #include ! #include #include "tnef.h" --- 27,33 ---- #include #include ! #include #include "tnef.h" *************** *** 42,54 **** "Public License. For more information about these matters, see the file\n" "named COPYING."; static const char* USAGE = \ ! "-f FILE, --file=FILE\tuse FILE as input ('-' == stdin)\n" ! "-d DIR, --directory=DIR\tput unpacked files in DIR\n" ! "-l, --list \tlist files, do not extract\n" ! "-n, --dry_run \tparse the file only\n" ! "-v, --verbose \tproduce verbose output\n" ! "-h, --help \tshow this message\n" ! "--version \tdisplay version and copyright\n" "\nIf FILE is not specified standard input is used\n" "\nReport bugs to \n"; --- 42,53 ---- "Public License. For more information about these matters, see the file\n" "named COPYING."; static const char* USAGE = \ ! "-f FILE\tuse FILE as input ('-' == stdin)\n" ! "-d DIR\tput unpacked files in DIR\n" ! "-l\tlist files, do not extract\n" ! "-n\tparse the file only\n" ! "-v\tproduce verbose output\n" ! "-h\tshow this message\n" "\nIf FILE is not specified standard input is used\n" "\nReport bugs to \n"; *************** *** 72,112 **** parse_cmdline (int argc, char **argv) { int i = 0; ! int option_index = 0; ! static struct option long_options[] = ! { ! {"file", required_argument, 0, 'f' }, ! {"directory", required_argument, 0, 'd' }, ! {"help", no_argument, 0, 'h'}, ! {"verbose", no_argument, 0, 'v'}, ! {"dry_run", no_argument, 0, 'n'}, ! {"list", no_argument, 0, 'l'}, /* for now same as -n */ ! {"version", no_argument, 0, 0}, ! { 0, 0, 0, 0 } ! }; ! while ((i = getopt_long (argc, argv, "f:d:vhnl", ! long_options, &option_index)) != -1) { switch (i) { - case 0: /* long options with no val field */ - if (strcmp (long_options[option_index].name, - "version") == 0) - { - fprintf (stderr, "%s %s\n", PACKAGE, VERSION); - fprintf (stderr, COPYRIGHTS); - fprintf (stderr, "\n"); - fprintf (stderr, NO_WARRANTY, PACKAGE, PACKAGE); - fprintf (stderr, "\n"); - exit (0); - } - else - { - abort (); /* impossible! */ - } - break; - case 'v': verbose = 1; break; --- 71,83 ---- parse_cmdline (int argc, char **argv) { int i = 0; ! extern char *optarg; ! extern int optind, optopt; ! while ((i = getopt (argc, argv, "f:d:vhnl")) != -1) { switch (i) { case 'v': verbose = 1; break; *** tnef.c.orig Fri Feb 4 11:12:38 2000 --- tnef.c Fri Feb 4 11:13:40 2000 *************** *** 43,52 **** #define GETINT16(p) (uint16)(p[0]+(p[1]<<8)) /* Program Options: */ ! static int Verbose_Output = 0; /* Shall we shout it from the rooftops? */ ! static int Dry_Run = 0; /* Parse file only */ ! static FILE* Input_File = NULL; /* Input File */ ! static char* Directory = NULL; /* Where to put output */ /* Array of days of the week for translating a date */ --- 43,52 ---- #define GETINT16(p) (uint16)(p[0]+(p[1]<<8)) /* Program Options: */ ! int Verbose_Output = 0; /* Shall we shout it from the rooftops? */ ! int Dry_Run = 0; /* Parse file only */ ! FILE* Input_File = NULL; /* Input File */ ! char* Directory = NULL; /* Where to put output */ /* Array of days of the week for translating a date */