summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 9454443..7547093 100644
--- a/src/options.c
+++ b/src/options.c
@@ -178,6 +178,7 @@ int options_parse(options_t* opt, int argc, char* argv[])
PARSE_STRING_PARAM("-x","--script", opt->script_)
PARSE_INT_PARAM("-m","--max-children", opt->max_children_)
PARSE_STRING_PARAM("-p","--children-policy", children_policy)
+ PARSE_INT_PARAM("-r","--children-min-runtime", opt->min_child_runtime_)
PARSE_STRING_LIST("-d","--dir", opt->dirs_)
else
return i;
@@ -243,6 +244,7 @@ void options_default(options_t* opt)
opt->script_ = strdup("newfile.sh");
opt->max_children_ = 8;
opt->children_policy_ = DEFER;
+ opt->min_child_runtime_ = -1;
string_list_init(&opt->dirs_);
}
@@ -288,6 +290,7 @@ void options_print_usage()
printf(" [-m|--max-children] <#of children> limit of children to be started e.g. 8\n");
printf(" [-p|--children-policy] (defer|drop|kill-oldest)\n");
printf(" what to do when children limit exceeds\n");
+ printf(" [-r|--children-min-runtime] in case of kill-oldest the minimum child runtime\n");
printf(" [-d|--dir] <path> add a path to the watch list, can be invoked several times\n");
}
@@ -315,5 +318,6 @@ void options_print(options_t* opt)
case DROP: printf("drop\n"); break;
case KILL_OLDEST: printf("kill oldest\n"); break;
}
+ printf("min_child_runtime: %d\n", opt->min_child_runtime_);
string_list_print(&opt->dirs_, " '", "'\n");
}