mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
parent
8f5658b77d
commit
e8c2360043
3 changed files with 34 additions and 23 deletions
|
@ -123,6 +123,13 @@ void display_usage() {
|
|||
std::cout << " module_name.param_name=value for setting module parameters.\n";
|
||||
std::cout << "Use 'z3 -p' for the complete list of global and module parameters.\n";
|
||||
}
|
||||
|
||||
static bool validate_is_ulong(char const* s) {
|
||||
for (; *s; ++s)
|
||||
if (*s < '0' || *s > '9')
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void parse_cmd_line_args(std::string& input_file, int argc, char ** argv) {
|
||||
long timeout = 0;
|
||||
|
@ -220,6 +227,8 @@ static void parse_cmd_line_args(std::string& input_file, int argc, char ** argv)
|
|||
else if (strcmp(opt_name, "v") == 0) {
|
||||
if (!opt_arg)
|
||||
error("option argument (-v:level) is missing.");
|
||||
if (!validate_is_ulong(opt_arg))
|
||||
error("invalid argument for -v option, it must be a non-negative integer.");
|
||||
long lvl = strtol(opt_arg, nullptr, 10);
|
||||
set_verbosity_level(lvl);
|
||||
}
|
||||
|
@ -229,6 +238,8 @@ static void parse_cmd_line_args(std::string& input_file, int argc, char ** argv)
|
|||
else if (strcmp(opt_name, "T") == 0) {
|
||||
if (!opt_arg)
|
||||
error("option argument (-T:timeout) is missing.");
|
||||
if (!validate_is_ulong(opt_arg))
|
||||
error("invalid argument for -T option, it must be a non-negative integer.");
|
||||
timeout = strtol(opt_arg, nullptr, 10);
|
||||
}
|
||||
else if (strcmp(opt_name, "t") == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue