]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Don't print duplicate sub-commands in help output main
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 19 Aug 2025 07:59:35 +0000 (10:59 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 22 Aug 2025 09:54:58 +0000 (09:54 +0000)
For example mailbox command output listed "cache|cache|..."

src/doveadm/doveadm.c

index 1f0743ae09e6127f9ddc3f72c076a562ce7a33f7..b1b3e78a10d22bac627836338bc2b45b9ca52d98 100644 (file)
@@ -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");
                        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",
                                fprintf(out, USAGE_CMDNAME_FMT" %s",
-                                       short_name, t_strcut(p + 1, ' '));
+                                       short_name, sub_name);
                                prev_name = short_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) {
                        } else {
                                sub_name = t_strcut(p + 1, ' ');
                                if (strcmp(prev_sub_name, sub_name) != 0) {