2 ***********************************************************
3 $SNARK_Header: S N A R K 1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4 $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/main.cpp $
5 $LastChangedRevision: 118 $
6 $Date: 2014-07-09 14:22:29 -0400 (Wed, 09 Jul 2014) $
8 ***********************************************************
13 //jk 12/08/07 combining snark with experimenter into a single program
14 #include <unistd.h> //provides routine for parsing the command line
19 #include "experimenter.h"
22 int main(int argc, char *argv[])
24 int choice = 1; //runs "plain snark" by default
26 extern int optind, optopt;
28 while ((c = getopt(argc, argv, "eh")) != -1)
36 fprintf(stderr, "\nsnark14 [-e] [-h] [input_file] [>>output_file]\n");
37 fprintf(stderr, " \tRuns snark14 image reconstruction program.\n");
38 fprintf(stderr, " \nOPTIONS:\n");
39 fprintf(stderr, " -e \truns the experimenter\n");
40 fprintf(stderr, " -h \tdisplays this help message\n");
41 fprintf(stderr, " input_file \tcontains input for either snark14 or experimenter \n");
42 fprintf(stderr, " >>output_file \toutput is redirected to this file\n\n");
46 "Unrecognized option: -%c\nRun \"snark14 -h\" for more information.\n\n",
53 if (argc - optind + 1 > 2)
55 fprintf(stderr, "ERROR: too many arguments on the command line.\n"
56 "Run \"snark14 -h\" for more information.\n\n");
62 //call snark14 and pass the parameters
63 snark(argc - optind + 1, argv);
67 //call snark14Experimenter and pass the parameters
68 experimenter(argc - optind + 1, argv);
72 fprintf(stderr, "Error: Invalid choice entered. \n\n");