From 8cc3bbfc406d380f93b87dad210ca84e6d7f65ba Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 6 Jan 1999 16:22:05 +0000 Subject: Byrial Jensen's fixes. svn path=/trunk/; revision=2335 --- options.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index 63238ea5..db6724c8 100644 --- a/options.c +++ b/options.c @@ -229,8 +229,9 @@ struct query *ctl; /* option record to be initialized */ */ int c; - int ocount = 0; /* count of destinations specified */ - int errflag = 0; /* TRUE when a syntax error is detected */ + int ocount = 0; /* count of destinations specified */ + int errflag = 0; /* TRUE when a syntax error is detected */ + int helpflag = 0; /* TRUE when option help was explicitly requested */ int option_index; char *buf, *cp; @@ -540,13 +541,13 @@ struct query *ctl; /* option record to be initialized */ case '?': case LA_HELP: default: - errflag++; + helpflag++; } } - if (errflag || ocount > 1) { + if (errflag || ocount > 1 || helpflag) { /* squawk if syntax errors were detected */ -#define P(s) fputs(s, stderr) +#define P(s) fputs(s, helpflag ? stdout : stderr) P(_("usage: fetchmail [options] [server ...]\n")); P(_(" Options are as follows:\n")); P(_(" -?, --help display this option help\n")); -- cgit v1.2.3