2 * bowtie_build_main.cpp
4 * Created on: Sep 16, 2009
18 int bowtie_build(int argc, const char **argv);
22 * bowtie-build main function. It is placed in a separate source file
23 * to make it slightly easier to compile as a library.
25 * If the user specifies -A <file> as the first two arguments, main
26 * will interpret that file as having one set of command-line arguments
27 * per line, and will dispatch each batch of arguments one at a time to
30 int main(int argc, const char **argv) {
31 if(argc > 2 && strcmp(argv[1], "-A") == 0) {
32 const char *file = argv[2];
37 while(in.getline(buf, 4095)) {
39 args.push_back(string(argv[0]));
40 tokenize(buf, " \t", args);
41 const char **myargs = (const char**)malloc(sizeof(char*)*args.size());
42 for(size_t i = 0; i < args.size(); i++) {
43 myargs[i] = args[i].c_str();
45 if(args.size() == 1) continue;
46 lastret = bowtie_build(args.size(), myargs);
50 cerr << "Warning: No arg strings parsed from " << file << endl;
55 return bowtie_build(argc, argv);