dovecot: Fail if any parameters other than --test is given.

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 4 07:22:48 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/d25860363eaf
changeset: 7327:d25860363eaf
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 04 07:22:25 2008 +0200
description:
Fail if any parameters other than --test is given.

diffstat:

1 file changed, 9 insertions(+), 3 deletions(-)
src/plugins/expire/expire-tool.c |   12 +++++++++---

diffs (29 lines):

diff -r 64c1d13202cb -r d25860363eaf src/plugins/expire/expire-tool.c
--- a/src/plugins/expire/expire-tool.c	Tue Mar 04 06:45:01 2008 +0200
+++ b/src/plugins/expire/expire-tool.c	Tue Mar 04 07:22:25 2008 +0200
@@ -286,16 +286,22 @@ static void expire_run(bool testrun)
 	dict_driver_unregister(&dict_driver_client);
 }
 
-int main(int argc, const char *argv[])
+int main(int argc ATTR_UNUSED, const char *argv[])
 {
 	struct ioloop *ioloop;
-	bool test;
+	bool test = FALSE;
 
 	lib_init();
 	lib_signals_init();
 	random_init();
 
-	test = argc > 1 && strcmp(argv[1], "--test") == 0;
+	while (argv[1] != NULL) {
+		if (strcmp(argv[1], "--test") == 0)
+			test = TRUE;
+		else
+			i_fatal("Unknown parameter: %s", argv[1]);
+		argv++;
+	}
 
 	ioloop = io_loop_create();
 	expire_run(test);


More information about the dovecot-cvs mailing list