From: Timo Sirainen Date: Fri, 28 May 2010 14:26:39 +0000 (+0100) Subject: doveadm help now also outputs to stdout. X-Git-Tag: 2.0.beta6~110 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f3bb0e10835efb0c9b1eb9e09e16b614ec41b97;p=thirdparty%2Fdovecot%2Fcore.git doveadm help now also outputs to stdout. --HG-- branch : HEAD --- diff --git a/src/doveadm/doveadm.c b/src/doveadm/doveadm.c index 737d1b577a..2fcbb16eec 100644 --- a/src/doveadm/doveadm.c +++ b/src/doveadm/doveadm.c @@ -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));