41 #ifdef CHECK_MEMORY_LEAKS
43 #endif // CHECK_MEMORY_LEAKS
52 if (argc == 2 && argv[1][0] !=
'-') {
54 check(
"-c", argv[1], ok);
57 for (
int i = 1; i < argc;) {
62 add =
check(argv[i], argv[i + 1], ok);
64 add =
check(argv[i], 0, ok);
68 WRITE_ERROR(
"On processing option '" + std::string(argv[i]) +
"':\n " + e.what());
89 std::string tmp(arg1 + 2);
90 size_t idx1 = tmp.find(
'=');
92 if (idx1 != std::string::npos) {
93 ok &= oc.
set(tmp.substr(0, idx1), tmp.substr(idx1 + 1));
95 if (arg2 == 0 || (oc.
isBool(
convert(arg1 + 2)) && arg2[0] ==
'-')) {
105 for (
int i = 1; arg1[i] != 0; i++) {
108 if (arg2 == 0 || arg2[0] ==
'-' || arg1[i + 1] != 0) {
118 if (arg2 == 0 || arg1[i + 1] != 0) {
137 if (strlen(arg) < 3) {
138 WRITE_ERROR(
"Missing value for parameter '" + std::string(arg).substr(0, 1) +
"'.");
141 return oc.
set(
convert(arg[0]), std::string(arg + 2));
144 if (strlen(arg) < 2) {
145 WRITE_ERROR(
"Missing value for parameter '" + std::string(arg) +
"'.");
148 return oc.
set(
convert(arg[0]), std::string(arg + 1));
156 if (arg1[0] !=
'-') {
157 WRITE_ERROR(
"The parameter '" + std::string(arg1) +
"' is not allowed in this context.\n Switch or parameter name expected.");
166 return arg1[1] !=
'-';