1046
1046
global_system_variables.transaction_message_threshold= in_transaction_message_threshold;
1049
static pair<string, string> parse_size_suffixes(string s)
1051
size_t equal_pos= s.find("=");
1052
if (equal_pos != string::npos)
1054
string arg_key(s.substr(0, equal_pos));
1055
string arg_val(s.substr(equal_pos+1));
1059
size_t size_suffix_pos= arg_val.find_last_of("kmgKMG");
1060
if (size_suffix_pos == arg_val.size()-1)
1062
char suffix= arg_val[size_suffix_pos];
1063
string size_val(arg_val.substr(0, size_suffix_pos));
1065
uint64_t base_size= boost::lexical_cast<uint64_t>(size_val);
1066
uint64_t new_size= 0;
1072
new_size= base_size * 1024;
1076
new_size= base_size * 1024 * 1024;
1080
new_size= base_size * 1024 * 1024 * 1024;
1083
return make_pair(arg_key,
1084
boost::lexical_cast<string>(new_size));
1089
/* Screw it, let the normal parser take over */
1093
return make_pair(string(""), string(""));
1096
static pair<string, string> parse_size_arg(string s)
1098
if (s.find("--") == 0)
1100
return parse_size_suffixes(s.substr(2));
1102
return make_pair(string(""), string(""));
1105
1049
static void process_defaults_files()
1107
1051
for (vector<string>::iterator iter= defaults_file_list.begin();
1503
1447
po::parsed_options final_parsed=
1504
1448
po::command_line_parser(unknown_options).style(style).
1505
options(full_options).extra_parser(parse_size_arg).run();
1449
options(full_options).extra_parser(dpo::parse_size_arg).run();
1507
1451
final_unknown_options=
1508
1452
po::collect_unrecognized(final_parsed.options, po::include_positional);