class Getopt
| 85 | // ***************************************************************************** |
| 86 | // class Getopt |
| 87 | int Getopt::getopt(int argc, char* const argv[], const std::string& optstring) { |
| 88 | progname_ = fs::path(argv[0]).filename().string(); |
| 89 | Util::optind = 0; // reset the Util::Getopt scanner |
| 90 | |
| 91 | while (!errcnt_) { |
| 92 | int c = Util::getopt(argc, argv, optstring.c_str()); |
| 93 | if (c == -1) { |
| 94 | break; |
| 95 | } |
| 96 | errcnt_ += option(c, Util::optarg ? Util::optarg : "", Util::optopt); |
| 97 | if (c == '?') { |
| 98 | break; |
| 99 | } |
| 100 | } |
| 101 | for (int i = Util::optind; i < argc; i++) { |
| 102 | errcnt_ += nonoption(argv[i]); |
| 103 | } |
| 104 | |
| 105 | return errcnt_; |
| 106 | } |
| 107 | |
| 108 | int Getopt::nonoption(const std::string& /*argv*/) { |
| 109 | return 0; |