diff -u -N ./main.cc ../bgrab/main.cc --- ./main.cc Mon Feb 1 03:04:23 1999 +++ ../bgrab/main.cc Tue Jul 27 10:38:26 1999 @@ -9,7 +9,6 @@ #include #include #include -#include } extern "C++" { @@ -19,7 +18,7 @@ #include "multipart.h" } -#define NNTP_PORT 119 +unsigned NNTP_PORT = 119; char *NNTP_SERVER = NULL; char *NNTP_GROUP = NULL; @@ -194,6 +193,10 @@ fprintf(stderr, "groupname newsgroup to read\n"); fprintf(stderr," -n don't output to stdout\n"); fprintf(stderr," -f fork to background. use only with -n\n"); + fprintf(stderr,"\nThe hostname or IP address of the news server can be\n"); + fprintf(stderr,"specified by the NNTPSERVER environment variable, or defaults\n"); + fprintf(stderr,"to \"news\". The port to connect to can be specified by the\n"); + fprintf(stderr,"NNTPPORT environment variable or defaults to 119.\n"); exit(-1); } @@ -225,6 +228,8 @@ void main(int argc, char **argv) { if (getenv("NNTPSERVER")) NNTP_SERVER = strdup(getenv("NNTPSERVER")); else NNTP_SERVER = strdup("news"); + + if (getenv("NNTPPORT")) NNTP_PORT = atoi(getenv("NNTPPORT")); process_command_line(argc, argv);