diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-22 14:01:04 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-22 14:01:04 +0200 |
commit | 97d84293615048b936d35250c89b21259acdb18f (patch) | |
tree | 51559cbc33b7953773061f28aa31c3816f39de1f /src/cmdline.opt | |
parent | d1ee123b443c2de4fb6e1622068611ab631a1f27 (diff) | |
download | wydawca-97d84293615048b936d35250c89b21259acdb18f.tar.gz wydawca-97d84293615048b936d35250c89b21259acdb18f.tar.bz2 |
Allow to select spools from the command line
Diffstat (limited to 'src/cmdline.opt')
-rw-r--r-- | src/cmdline.opt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt index ec457de..53bdd00 100644 --- a/src/cmdline.opt +++ b/src/cmdline.opt @@ -17,6 +17,22 @@ static struct obstack pp_cmd_stack; static int pp_cmd_stack_init; +static gl_list_t source_list; + +static bool +source_eq (const void *elt1, const void *elt2) +{ + return strcmp ((const char *)elt1, (const char *)elt2) == 0; +} + +int +enabled_spool_p (const struct spool *spool) +{ + if (!source_list) + return 1; + return !!gl_list_search (source_list, spool->source_dir); +} + OPTIONS_BEGIN(gnu, "wydawca", [<wydawca synchronizes files from a set of upload directories with the corresponding distribution sites>], [<UID [UID...]>]) @@ -51,6 +67,16 @@ BEGIN conffile = optarg; END +OPTION(source,s,SOURCE-DIR, + [<process only spool with the given source (may be used multiple times)>]) +BEGIN + if (!source_list) + source_list = gl_list_create_empty (&gl_linked_list_implementation, + source_eq, NULL, + NULL, false); + gl_list_add_last (source_list, optarg); +END + GROUP(Logging) OPTION(cron,,, |