| 45 | } |
| 46 | |
| 47 | void |
| 48 | parse_args(int argc, char **argv, config& conf) |
| 49 | { |
| 50 | for (int i = 1; i < argc; ++i) { |
| 51 | const char *const arg = argv[i]; |
| 52 | const char *const eq = strchr(arg, '='); |
| 53 | if (eq == 0) { |
| 54 | continue; |
| 55 | } |
| 56 | const std::string key(arg, eq - arg); |
| 57 | const std::string val(eq + 1); |
| 58 | conf[key] = val; |
| 59 | } |
| 60 | config::const_iterator iter = conf.find("verbose"); |
| 61 | if (iter != conf.end()) { |
| 62 | verbose_level = atoi(iter->second.c_str()); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | }; |
| 67 |