added -P for should_do_judge_according_time()
This commit is contained in:
@@ -108,6 +108,7 @@ static struct option long_options[] = {
|
||||
{"upload-port", required_argument, NULL, 'p'},
|
||||
{"workspace", required_argument, NULL, 'w'},
|
||||
{"threshold", required_argument, NULL, 'r'},
|
||||
{"time-period", required_argument, NULL, 'P'},
|
||||
{0, 0, 0}};
|
||||
|
||||
void print_usage(char *cmd)
|
||||
@@ -154,10 +155,11 @@ void parse_options(int argc, char **argv)
|
||||
int thresh;
|
||||
conf_threshold = DEFAULT_CONF_THRESHOLD;
|
||||
char *cmd = argv[0];
|
||||
int ok;
|
||||
while (1)
|
||||
{
|
||||
int option_index = 0;
|
||||
c = getopt_long_only(argc, argv, "es:m:w:c:t:p:r:", long_options, &option_index);
|
||||
c = getopt_long_only(argc, argv, "es:m:w:c:t:p:r:P:", long_options, &option_index);
|
||||
if (c == -1)
|
||||
{
|
||||
break;
|
||||
@@ -200,6 +202,13 @@ void parse_options(int argc, char **argv)
|
||||
}
|
||||
conf_threshold = (float)thresh / 100.0;
|
||||
break;
|
||||
case 'P':
|
||||
ok = get_all_time_period_from_arguments(optarg);
|
||||
if (ok != 0) {
|
||||
printf("failed to parse time period\n");
|
||||
exit(-1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
print_usage(cmd);
|
||||
exit(-1);
|
||||
|
||||
Reference in New Issue
Block a user