summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'options.c')
-rw-r--r--options.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/options.c b/options.c
index d567891..6298f9d 100644
--- a/options.c
+++ b/options.c
@@ -175,6 +175,7 @@ int options_parse(options_t* opt, int argc, char* argv[])
PARSE_STRING_PARAM("-s","--command-sock", opt->command_sock_)
PARSE_STRING_PARAM("-x","--script", opt->script_)
PARSE_INT_PARAM("-m","--max-children", opt->max_children_)
+ PARSE_STRING_LIST("-d","--dir", opt->dirs_)
else
return i;
}
@@ -215,6 +216,7 @@ void options_default(options_t* opt)
opt->command_sock_ = strdup("/var/run/rhdropbox/cmd.sock");
opt->script_ = strdup("newfile.sh");
opt->max_children_ = 8;
+ string_list_init(&opt->dirs_);
}
void options_clear(options_t* opt)
@@ -238,6 +240,7 @@ void options_clear(options_t* opt)
free(opt->command_sock_);
if(opt->script_)
free(opt->script_);
+ string_list_clear(&opt->dirs_);
}
void options_print_usage()
@@ -255,6 +258,7 @@ void options_print_usage()
printf(" [-s|--command-sock] <unix sock> the command socket e.g. /var/run/rhdropbox/cmd.sock\n");
printf(" [-x|--script] <script> the command socket e.g. newfile.sh\n");
printf(" [-m|--max-children] <#of children> limit of children to be started e.g. 8\n");
+ printf(" [-d|--dir] <path> add a path to the watch list, can be invoked several times\n");
}
void options_print(options_t* opt)
@@ -274,4 +278,5 @@ void options_print(options_t* opt)
printf("command_sock: '%s'\n", opt->command_sock_);
printf("script: '%s'\n", opt->script_);
printf("max_children: %d\n", opt->max_children_);
+ string_list_print(&opt->dirs_, " '", "'\n");
}