From 23d2a3f3b4253c3ca2b34e4d852a72d9b6e2bc71 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 19 Aug 2025 10:59:35 +0300 Subject: [PATCH] doveadm: Don't print duplicate sub-commands in help output For example mailbox command output listed "cache|cache|..." --- src/doveadm/doveadm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/doveadm/doveadm.c b/src/doveadm/doveadm.c index 1f0743ae09..b1b3e78a10 100644 --- a/src/doveadm/doveadm.c +++ b/src/doveadm/doveadm.c @@ -81,10 +81,11 @@ usage_commands_write(FILE *out, const ARRAY_TYPE(doveadm_cmd_ver2_p) *cmds, if (strcmp(prev_name, short_name) != 0) { if (*prev_name != '\0') fprintf(out, "\n"); + sub_name = t_strcut(p + 1, ' '); fprintf(out, USAGE_CMDNAME_FMT" %s", - short_name, t_strcut(p + 1, ' ')); + short_name, sub_name); prev_name = short_name; - prev_sub_name = ""; + prev_sub_name = sub_name; } else { sub_name = t_strcut(p + 1, ' '); if (strcmp(prev_sub_name, sub_name) != 0) { -- 2.47.2