Allow proper ftp verbosity with a new -v flag.

This commit is contained in:
Jordan K. Hubbard 1996-08-31 22:03:05 +00:00
parent 55158625b4
commit 7ae26f1450
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17979
2 changed files with 13 additions and 8 deletions

View file

@ -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

View file

@ -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);