#include <vector>
#include <AXE/String.h>
#include <AXE/date.h>
+#include <getopt.h>
class BankTemplate
{
const int DESCRIP5 = 14;
const int DESCRIP6 = 15;
-main()
+static char helptext[] =
+ "Usage: bank [options] filename\n"
+ "\n"
+ "Options:\n"
+ " --help : Print this helpful message\n"
+ " -V\n"
+ " --version : Print the version number\n";
+
+static struct option long_options[] =
+{
+ { "help", no_argument, 0, 'h' },
+ { "version", no_argument, 0, 'V' },
+ { 0, 0, 0, 0 }
+};
+
+main(int argc, char *argv[])
{
+ int c;
+
+ int option_index = 0;
+
+ while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1)
+ {
+ switch (c)
+ {
+ case 'h':
+ std::cout << helptext;
+ exit(0);
+ break;
+
+ case 'V':
+ std::cout << "bank version 1.1\n";
+ exit(0);
+ break;
+
+ }
+ }
+
+ if (optind == argc)
+ {
+ std::cerr << "Usage: bank [options] filename\n";
+ exit(1);
+ }
+
//read_templates("Bank.templ");
std::vector<BankTemplate> templates = read_templates("Bank.templ");
- read_mutations("mut.txt", templates);
+ read_mutations(argv[optind], templates);
}
std::vector<BankTemplate> read_templates(const char * filename)