From 2a0c5c491511c5145fc0a8d48568aeaf9d459263 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 11 Oct 1996 16:07:00 +0000 Subject: Option reorganization. svn path=/trunk/; revision=309 --- fetchmail.c | 30 +++++++++++------------------- options.c | 56 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 39 insertions(+), 47 deletions(-) diff --git a/fetchmail.c b/fetchmail.c index ba70a6a4..20481783 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -39,7 +39,6 @@ #ifdef HAVE_PROTOTYPES /* prototypes for internal functions */ -static int showversioninfo (void); static int dump_options (struct hostrec *queryctl); static int query_host(struct hostrec *queryctl); #endif @@ -141,7 +140,7 @@ char **argv; exit(PS_SYNTAX); if (versioninfo) - showversioninfo(); + printf("This is fetchmail release %s\n", RELEASE_ID); /* this builds the host list */ if (prc_parse_file(rcfile) != 0) @@ -460,20 +459,6 @@ struct hostrec *queryctl; return(PS_PROTOCOL); } } - -/********************************************************************* - function: showversioninfo - description: display program release - arguments: none. - return value: none. - calls: none. - globals: none. - *********************************************************************/ - -static int showversioninfo() -{ - printf("This is fetchmail release %s\n",RELEASE_ID); -} /********************************************************************* function: dump_params @@ -502,15 +487,21 @@ struct hostrec *queryctl; printf(" APOP secret = '%s'\n", queryctl->password); else printf(" Password = '%s'\n", queryctl->password); - if (queryctl->protocol == P_POP3 && queryctl->port == KPOP_PORT) + if (queryctl->protocol == P_POP3 + && queryctl->port == KPOP_PORT + && queryctl->authenticate == A_KERBEROS) printf(" Protocol is KPOP"); else + { printf(" Protocol is %s", showproto(queryctl->protocol)); + } if (queryctl->port) printf(" (using port %d)", queryctl->port); else if (outlevel == O_VERBOSE) printf(" (using default port)"); putchar('\n'); + if (queryctl->authenticate == A_KERBEROS) + printf(" Kerberos authentication enabled.\n"); printf(" Fetched messages will%s be kept on the server (--keep %s).\n", queryctl->keep ? "" : " not", @@ -521,7 +512,7 @@ struct hostrec *queryctl; printf(" Old messages will%s be flushed before message retrieval (--flush %s).\n", queryctl->flush ? "" : " not", queryctl->flush ? "on" : "off"); - printf(" Rewrite of server-local addresses is %sabled (--norewrite %s)\n", + printf(" Rewrite of server-local addresses is %sabled (--norewrite %s).\n", queryctl->norewrite ? "dis" : "en", queryctl->norewrite ? "on" : "off"); if (queryctl->mda[0]) @@ -535,7 +526,8 @@ struct hostrec *queryctl; putchar('\n'); } else - printf(" Messages will be SMTP-forwarded to '%s'\n", queryctl->smtphost); + printf(" Messages will be SMTP-forwarded to '%s'.\n", + queryctl->smtphost); if (queryctl->protocol > P_POP2) if (!queryctl->oldsaved) printf(" No UIDs saved from this host.\n"); diff --git a/options.c b/options.c index 7d020e81..bab65654 100644 --- a/options.c +++ b/options.c @@ -43,38 +43,38 @@ static char *shortoptions = "?Vcsvd:qL:f:i:p:P:A:u:akKFnr:S:m:y"; static struct option longoptions[] = { - {"help", no_argument, (int *) 0, LA_HELP }, - {"version", no_argument, (int *) 0, LA_VERSION }, - {"check", no_argument, (int *) 0, LA_CHECK }, - {"silent", no_argument, (int *) 0, LA_SILENT }, - {"verbose", no_argument, (int *) 0, LA_VERBOSE }, - {"daemon", required_argument, (int *) 0, LA_DAEMON }, - {"quit", no_argument, (int *) 0, LA_QUIT }, - {"logfile", required_argument, (int *) 0, LA_LOGFILE }, - {"fetchmailrc",required_argument,(int *) 0, LA_RCFILE }, - {"idfile", required_argument, (int *) 0, LA_IDFILE }, + {"help", no_argument, (int *) 0, LA_HELP }, + {"version", no_argument, (int *) 0, LA_VERSION }, + {"check", no_argument, (int *) 0, LA_CHECK }, + {"silent", no_argument, (int *) 0, LA_SILENT }, + {"verbose", no_argument, (int *) 0, LA_VERBOSE }, + {"daemon", required_argument, (int *) 0, LA_DAEMON }, + {"quit", no_argument, (int *) 0, LA_QUIT }, + {"logfile", required_argument, (int *) 0, LA_LOGFILE }, + {"fetchmailrc",required_argument,(int *) 0, LA_RCFILE }, + {"idfile", required_argument, (int *) 0, LA_IDFILE }, - {"protocol", required_argument, (int *) 0, LA_PROTOCOL }, - {"proto", required_argument, (int *) 0, LA_PROTOCOL }, - {"port", required_argument, (int *) 0, LA_PORT }, - {"auth", required_argument, (int *) 0, LA_PROTOCOL }, + {"protocol", required_argument, (int *) 0, LA_PROTOCOL }, + {"proto", required_argument, (int *) 0, LA_PROTOCOL }, + {"port", required_argument, (int *) 0, LA_PORT }, + {"auth", required_argument, (int *) 0, LA_AUTHENTICATE}, - {"user", required_argument, (int *) 0, LA_USERNAME }, - {"username", required_argument, (int *) 0, LA_USERNAME }, + {"user", required_argument, (int *) 0, LA_USERNAME }, + {"username", required_argument, (int *) 0, LA_USERNAME }, - {"all", no_argument, (int *) 0, LA_ALL }, - {"kill", no_argument, (int *) 0, LA_KILL }, - {"keep", no_argument, (int *) 0, LA_KEEP }, - {"flush", no_argument, (int *) 0, LA_FLUSH }, - {"norewrite", no_argument, (int *) 0, LA_NOREWRITE }, + {"all", no_argument, (int *) 0, LA_ALL }, + {"kill", no_argument, (int *) 0, LA_KILL }, + {"keep", no_argument, (int *) 0, LA_KEEP }, + {"flush", no_argument, (int *) 0, LA_FLUSH }, + {"norewrite", no_argument, (int *) 0, LA_NOREWRITE }, - {"remote", required_argument, (int *) 0, LA_REMOTEFILE }, - {"smtphost", required_argument, (int *) 0, LA_SMTPHOST }, - {"mda", required_argument, (int *) 0, LA_MDA }, + {"remote", required_argument, (int *) 0, LA_REMOTEFILE }, + {"smtphost", required_argument, (int *) 0, LA_SMTPHOST }, + {"mda", required_argument, (int *) 0, LA_MDA }, - {"yydebug", no_argument, (int *) 0, LA_YYDEBUG }, + {"yydebug", no_argument, (int *) 0, LA_YYDEBUG }, - {(char *) 0, no_argument, (int *) 0, 0 } + {(char *) 0, no_argument, (int *) 0, 0 } }; @@ -171,7 +171,7 @@ struct hostrec *queryctl; queryctl->authenticate == A_KERBEROS; } else { - fprintf(stderr,"Invalid protocol '%s'\n specified.\n", optarg); + fprintf(stderr,"Invalid protocol `%s' specified.\n", optarg); errflag++; } break; @@ -186,7 +186,7 @@ struct hostrec *queryctl; else if (strcmp(optarg, "kerberos") == 0) queryctl->authenticate = A_KERBEROS; else { - fprintf(stderr,"Invalid authentication '%s'\n specified.\n", optarg); + fprintf(stderr,"Invalid authentication `%s' specified.\n", optarg); errflag++; } break; -- cgit v1.2.3