]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm help <cmd> now also outputs to stdout.
authorTimo Sirainen <tss@iki.fi>
Fri, 28 May 2010 14:26:39 +0000 (15:26 +0100)
committerTimo Sirainen <tss@iki.fi>
Fri, 28 May 2010 14:26:39 +0000 (15:26 +0100)
--HG--
branch : HEAD

src/doveadm/doveadm.c

index 737d1b577a4ba96eb449f35618f20d84a10f526b..2fcbb16eec2fc8eefe069d5eaeedcec81dbae283 100644 (file)
@@ -45,14 +45,19 @@ void usage(void)
        usage_to(stderr);
 }
 
-void help(const struct doveadm_cmd *cmd)
+static void help_to(const struct doveadm_cmd *cmd, FILE *out)
 {
-       fprintf(stderr, "doveadm %s %s\n", cmd->name, cmd->short_usage);
+       fprintf(out, "doveadm %s %s\n", cmd->name, cmd->short_usage);
        if (cmd->long_usage != NULL)
-               fprintf(stderr, "%s", cmd->long_usage);
+               fprintf(out, "%s", cmd->long_usage);
        exit(0);
 }
 
+void help(const struct doveadm_cmd *cmd)
+{
+       help_to(cmd, stdout);
+}
+
 const char *unixdate2str(time_t timestamp)
 {
        static char buf[64];
@@ -94,7 +99,7 @@ static void cmd_help(int argc, char *argv[])
 
                array_foreach(&doveadm_cmds, cmd) {
                        if (strcmp(cmd->name, str_c(name)) == 0)
-                               help(cmd);
+                               help_to(cmd, stdout);
                }
                doveadm_mail_try_help_name(str_c(name));