| 432 | } |
| 433 | |
| 434 | int |
| 435 | main(int argc, char** argv) |
| 436 | { |
| 437 | opt::trimMasked = false; |
| 438 | |
| 439 | string commandLine; |
| 440 | { |
| 441 | ostringstream ss; |
| 442 | char** last = argv + argc - 1; |
| 443 | copy(argv, last, ostream_iterator<const char*>(ss, " ")); |
| 444 | ss << *last; |
| 445 | commandLine = ss.str(); |
| 446 | } |
| 447 | |
| 448 | if (!opt::db.empty()) |
| 449 | opt::metaVars.resize(3); |
| 450 | |
| 451 | bool die = false; |
| 452 | for (int c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { |
| 453 | istringstream arg(optarg != NULL ? optarg : ""); |
| 454 | switch (c) { |
| 455 | case '?': |
| 456 | die = true; |
| 457 | break; |
| 458 | case 'g': |
| 459 | arg >> opt::graphPath; |
| 460 | break; |
| 461 | case 'k': |
| 462 | arg >> opt::k; |
| 463 | break; |
| 464 | case 'o': |
| 465 | arg >> opt::out; |
| 466 | break; |
| 467 | case 'v': |
| 468 | opt::verbose++; |
| 469 | break; |
| 470 | case OPT_HELP: |
| 471 | cout << USAGE_MESSAGE; |
| 472 | exit(EXIT_SUCCESS); |
| 473 | case OPT_VERSION: |
| 474 | cout << VERSION_MESSAGE; |
| 475 | exit(EXIT_SUCCESS); |
| 476 | case OPT_DB: |
| 477 | arg >> opt::db; |
| 478 | break; |
| 479 | case OPT_LIBRARY: |
| 480 | arg >> opt::metaVars[0]; |
| 481 | break; |
| 482 | case OPT_STRAIN: |
| 483 | arg >> opt::metaVars[1]; |
| 484 | break; |
| 485 | case OPT_SPECIES: |
| 486 | arg >> opt::metaVars[2]; |
| 487 | break; |
| 488 | } |
| 489 | if (optarg != NULL && !arg.eof()) { |
| 490 | cerr << PROGRAM ": invalid option: `-" << (char)c << optarg << "'\n"; |
| 491 | exit(EXIT_FAILURE); |
nothing calls this directly
no test coverage detected