| 575 | } |
| 576 | |
| 577 | int |
| 578 | main(int argc, char** argv) |
| 579 | { |
| 580 | string commandLine; |
| 581 | { |
| 582 | ostringstream ss; |
| 583 | char** last = argv + argc - 1; |
| 584 | copy(argv, last, ostream_iterator<const char*>(ss, " ")); |
| 585 | ss << *last; |
| 586 | commandLine = ss.str(); |
| 587 | } |
| 588 | |
| 589 | if (!opt::db.empty()) |
| 590 | opt::metaVars.resize(3); |
| 591 | |
| 592 | bool die = false; |
| 593 | for (int c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { |
| 594 | istringstream arg(optarg != NULL ? optarg : ""); |
| 595 | switch (c) { |
| 596 | case '?': |
| 597 | die = true; |
| 598 | break; |
| 599 | case 'g': |
| 600 | arg >> opt::graphPath; |
| 601 | break; |
| 602 | case 'k': |
| 603 | arg >> opt::k; |
| 604 | break; |
| 605 | case 'r': |
| 606 | arg >> opt::repeatContigs; |
| 607 | break; |
| 608 | case 'v': |
| 609 | opt::verbose++; |
| 610 | break; |
| 611 | case OPT_HELP: |
| 612 | cout << USAGE_MESSAGE; |
| 613 | exit(EXIT_SUCCESS); |
| 614 | case OPT_VERSION: |
| 615 | cout << VERSION_MESSAGE; |
| 616 | exit(EXIT_SUCCESS); |
| 617 | case OPT_DB: |
| 618 | arg >> opt::db; |
| 619 | break; |
| 620 | case OPT_LIBRARY: |
| 621 | arg >> opt::metaVars[0]; |
| 622 | break; |
| 623 | case OPT_STRAIN: |
| 624 | arg >> opt::metaVars[1]; |
| 625 | break; |
| 626 | case OPT_SPECIES: |
| 627 | arg >> opt::metaVars[2]; |
| 628 | break; |
| 629 | } |
| 630 | if (optarg != NULL && !arg.eof()) { |
| 631 | cerr << PROGRAM ": invalid option: `-" << (char)c << optarg << "'\n"; |
| 632 | exit(EXIT_FAILURE); |
| 633 | } |
| 634 | } |
nothing calls this directly
no test coverage detected