diff options
author | jkh <jkh@FreeBSD.org> | 1996-08-31 22:03:05 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-08-31 22:03:05 +0000 |
commit | 2ae01aec12a5da8cdffd15e0318368c77ef72359 (patch) | |
tree | 52aaaebb5901b368f439932d735e1a1cc4ec803c /usr.bin/fetch | |
parent | c2808567e46e1d528941938a2e47a2842490de9a (diff) | |
download | FreeBSD-src-2ae01aec12a5da8cdffd15e0318368c77ef72359.zip FreeBSD-src-2ae01aec12a5da8cdffd15e0318368c77ef72359.tar.gz |
Allow proper ftp verbosity with a new -v flag.
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r-- | usr.bin/fetch/fetch.1 | 4 | ||||
-rw-r--r-- | usr.bin/fetch/main.c | 17 |
2 files changed, 13 insertions, 8 deletions
diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1 index e6cd0c5..87563ae 100644 --- a/usr.bin/fetch/fetch.1 +++ b/usr.bin/fetch/fetch.1 @@ -1,4 +1,4 @@ -.\" $Id: fetch.1,v 1.5 1996/08/22 21:30:50 jkh Exp $ +.\" $Id: fetch.1,v 1.6 1996/08/23 00:55:57 mpp Exp $ .Dd July 2, 1996 .Dt FETCH 1 .Os @@ -86,6 +86,8 @@ Overrides environment variable, if set. .It Fl q Quiet mode. Do not report transfer progress on the terminal. +.It Fl v +Verbose mode - display FTP connection information in painful detail. .It Fl r Reget. Use this flag to restart an interrupted transfer. .It Fl o Ar file diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c index fb8d7c5..2239a26 100644 --- a/usr.bin/fetch/main.c +++ b/usr.bin/fetch/main.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. */ -/* $Id: main.c,v 1.18 1996/08/22 23:25:24 jkh Exp $ */ +/* $Id: main.c,v 1.19 1996/08/23 06:21:17 jkh Exp $ */ #include <stdlib.h> #include <stdio.h> @@ -55,6 +55,7 @@ char buffer[BUFFER_SIZE]; char *progname; int verbose = 1; +int ftp_verbose = 0; int linkfile = 0; char *outputfile = 0; char *change_to_dir = 0; @@ -84,7 +85,7 @@ int match(char *, char *), http_open(void); void usage() { - fprintf(stderr, "usage: %s [-DHINPMTVLqlmnpr] [-o outputfile] <-f file -h host [-c dir]| URL>\n", progname); + fprintf(stderr, "usage: %s [-DHINPMTVLqlmnprv] [-o outputfile] <-f file -h host [-c dir]| URL>\n", progname); exit(1); } @@ -135,7 +136,7 @@ main(int argc, char **argv) progname = s ? s+1 : argv[0]; - while ((c = getopt (argc, argv, "D:HINPMT:V:Lqc:f:h:o:plmnr")) != EOF) { + while ((c = getopt (argc, argv, "D:HINPMT:V:Lqc:f:h:o:plmnrv")) != EOF) { switch (c) { case 'D': case 'H': case 'I': case 'N': case 'L': case 'V': break; /* ncftp compatibility */ @@ -179,6 +180,10 @@ main(int argc, char **argv) restart = 1; break; + case 'v': + ftp_verbose = 1; + break; + case 'T': timeout_ival = atoi(optarg); break; @@ -210,7 +215,7 @@ main(int argc, char **argv) signal(SIGTERM, die); setup_http_proxy(); - + if (http) httpget(); else if (ftp) @@ -285,12 +290,10 @@ ftpget() } if ((lp = getenv("FTP_LOGIN")) == NULL) lp = "anonymous"; - ftp = ftpLogin(host, lp, ftp_pw, 0, verbose); + ftp = ftpLogin(host, lp, ftp_pw, 0, ftp_verbose); if (!ftp) err(1, "couldn't open FTP connection or login to %s.", host); - ftpVerbose (ftp, 0); - /* Time to set our defaults */ ftpBinary (ftp); ftpPassive (ftp, passive_mode); |