dovecot-2.1: doveadm instance list: Added optional name paramete...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 4 17:23:19 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/fa75bd3245a4
changeset: 14548:fa75bd3245a4
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 04 17:23:07 2012 +0300
description:
doveadm instance list: Added optional name parameter to list only specified instance.

diffstat:

 src/doveadm/doveadm-instance.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 61be33b6336c -r fa75bd3245a4 src/doveadm/doveadm-instance.c
--- a/src/doveadm/doveadm-instance.c	Mon Jun 04 14:03:47 2012 +0300
+++ b/src/doveadm/doveadm-instance.c	Mon Jun 04 17:23:07 2012 +0300
@@ -42,7 +42,7 @@
 	return found;
 }
 
-static void cmd_instance_list(int argc ATTR_UNUSED, char *argv[] ATTR_UNUSED)
+static void cmd_instance_list(int argc, char *argv[])
 {
 	struct master_instance_list *list;
 	struct master_instance_list_iter *iter;
@@ -58,6 +58,9 @@
 	list = master_instance_list_init(MASTER_INSTANCE_PATH);
 	iter = master_instance_list_iterate_init(list);
 	while ((inst = master_instance_iterate_list_next(iter)) != NULL) {
+		if (argc > 1 && strcmp(argv[1], inst->name) != 0)
+			continue;
+
 		doveadm_print(inst->base_dir);
 		doveadm_print(inst->name);
 		doveadm_print(unixdate2str(inst->last_used));
@@ -95,7 +98,7 @@
 }
 
 struct doveadm_cmd doveadm_cmd_instance[] = {
-	{ cmd_instance_list, "instance list", "" },
+	{ cmd_instance_list, "instance list", "[<name>]" },
 	{ cmd_instance_remove, "instance remove", "<name> | <base dir>" }
 };
 


More information about the dovecot-cvs mailing list