in src/options.h [96:123]
bool arg_to_number(OptionType opt, size_t block_size, T * ret) {
// fail if option wasn't given
if (!opts.count(opt)) return false;
// get the option
DiskspdOption& option = opt_map[opts[opt]];
// check there's an actual arg, if not, succeed but do nothing
if (!option.arg.c_str()[0]) return true;
unsigned long long result;
// check if it's a number
if (option.flags & OPT_NUMERIC) {
result = strtoull(option.arg.c_str(), NULL, 10);
// check if it's a byte size
} else if (option.flags & OPT_BYTE_SIZE) {
result = byte_size_from_arg(option.arg.c_str(), block_size);
} else {
assert(!"Invalid argument passed to arg_to_number!"); // programmer error
}
if (result > std::numeric_limits<T>::max()) {
fprintf(stderr, "Argument to -%c too large\n", (char)option.opt.key);
exit(1);
}
*ret = static_cast<T>(result);
return true;
}