From: Andre Noll Date: Sun, 1 Jun 2008 16:32:49 +0000 (+0200) Subject: --base-dir must not be a required option. X-Git-Tag: v0.0.2~13 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=7e80bf7f2a7fe2c3925d7b1b45ea1f52281b338f;p=adu.git --base-dir must not be a required option. Otherwise, gengetopt would complain if it is not given even in --select mode. Make it optional and check manually whether it is given in --create mode. --- diff --git a/adu.c b/adu.c index c35c535..8640067 100644 --- a/adu.c +++ b/adu.c @@ -470,6 +470,10 @@ static int check_args(void) { int i, ret; + + if (conf.create_given && !conf.base_dir_given) + return -E_SYNTAX; + /* remove trailing slashes from base-dir arg */ if (conf.base_dir_given) { size_t len = strlen(conf.base_dir_arg); diff --git a/adu.ggo b/adu.ggo index a2a6c03..9f8b710 100644 --- a/adu.ggo +++ b/adu.ggo @@ -125,12 +125,13 @@ option "base-dir" b "directory to traverse" string typestr="path" dependon="create" -required +optional details=" - The base directory to be traversed recursively. A warning - message is printed for each subdirectory that could not be - read because of insufficient permission. These directories - will be ignored when computing statistics. + The base directory to be traversed recursively. Must be + given if --create mode was selected. A warning message is + printed for each subdirectory that could not be read because + of insufficient permission. These directories will be ignored + when computing statistics. " option "one-file-system" x