diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-02-11 09:41:23 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-02-11 09:41:23 (GMT) |
commit | e6d92c3f894d749168af7a6c0a873f7c5125e8a7 (patch) | |
tree | 9958a1a00d89a54552482a803df2fdb242319e12 /options.c | |
parent | 48a4b144b6f79fe16f59ca7d9f45c409e2de4bce (diff) |
added -d|--dirs parameter to options parser
cleaned up manpage
Diffstat (limited to 'options.c')
-rw-r--r-- | options.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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"); } |