#include #include #include #include #include #include #include "xex.h" #define SELF "f2toxex" void version() { printf(SELF " " VERSION "\n"); } void usage() { version(); printf(" Usage: " SELF " [-h | -v] | infile [outfile]\n"); } char *make_outfile(char *infile) { } int main(int argc, char **argv) { int c; char *infile, *outfile; while( (c = getopt(argc, argv, "hv")) > 0) { switch(c) { case 'h': usage(); exit(0); break; case 'v': version(); exit(0); break; default: fprintf(stderr, SELF ": unknown option '-%c'.\n", c); usage(); exit(1); break; } } if(argc > optind) { infile = argv[optind]; optind++; } if(argc > optind) { strcpy(outfile, argv[optind]); optind++; if(argc > optind) fprintf(stderr, SELF ": " "ignoring extra junk on command line: '%s'.\n", argv[optind]); } else if(strcmp(infile, "-") != 0) { outfile = make_outfile(infile); } return 0; }