Allow proper ftp verbosity with a new -v flag.
This commit is contained in:
parent
55158625b4
commit
7ae26f1450
@ -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
|
.Dd July 2, 1996
|
||||||
.Dt FETCH 1
|
.Dt FETCH 1
|
||||||
.Os
|
.Os
|
||||||
@ -86,6 +86,8 @@ Overrides
|
|||||||
environment variable, if set.
|
environment variable, if set.
|
||||||
.It Fl q
|
.It Fl q
|
||||||
Quiet mode. Do not report transfer progress on the terminal.
|
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
|
.It Fl r
|
||||||
Reget. Use this flag to restart an interrupted transfer.
|
Reget. Use this flag to restart an interrupted transfer.
|
||||||
.It Fl o Ar file
|
.It Fl o Ar file
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* SUCH DAMAGE.
|
* 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 <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -55,6 +55,7 @@ char buffer[BUFFER_SIZE];
|
|||||||
char *progname;
|
char *progname;
|
||||||
|
|
||||||
int verbose = 1;
|
int verbose = 1;
|
||||||
|
int ftp_verbose = 0;
|
||||||
int linkfile = 0;
|
int linkfile = 0;
|
||||||
char *outputfile = 0;
|
char *outputfile = 0;
|
||||||
char *change_to_dir = 0;
|
char *change_to_dir = 0;
|
||||||
@ -84,7 +85,7 @@ int match(char *, char *), http_open(void);
|
|||||||
void
|
void
|
||||||
usage()
|
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);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
progname = s ? s+1 : argv[0];
|
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) {
|
switch (c) {
|
||||||
case 'D': case 'H': case 'I': case 'N': case 'L': case 'V':
|
case 'D': case 'H': case 'I': case 'N': case 'L': case 'V':
|
||||||
break; /* ncftp compatibility */
|
break; /* ncftp compatibility */
|
||||||
@ -179,6 +180,10 @@ main(int argc, char **argv)
|
|||||||
restart = 1;
|
restart = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'v':
|
||||||
|
ftp_verbose = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
timeout_ival = atoi(optarg);
|
timeout_ival = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
@ -210,7 +215,7 @@ main(int argc, char **argv)
|
|||||||
signal(SIGTERM, die);
|
signal(SIGTERM, die);
|
||||||
|
|
||||||
setup_http_proxy();
|
setup_http_proxy();
|
||||||
|
|
||||||
if (http)
|
if (http)
|
||||||
httpget();
|
httpget();
|
||||||
else if (ftp)
|
else if (ftp)
|
||||||
@ -285,12 +290,10 @@ ftpget()
|
|||||||
}
|
}
|
||||||
if ((lp = getenv("FTP_LOGIN")) == NULL)
|
if ((lp = getenv("FTP_LOGIN")) == NULL)
|
||||||
lp = "anonymous";
|
lp = "anonymous";
|
||||||
ftp = ftpLogin(host, lp, ftp_pw, 0, verbose);
|
ftp = ftpLogin(host, lp, ftp_pw, 0, ftp_verbose);
|
||||||
if (!ftp)
|
if (!ftp)
|
||||||
err(1, "couldn't open FTP connection or login to %s.", host);
|
err(1, "couldn't open FTP connection or login to %s.", host);
|
||||||
|
|
||||||
ftpVerbose (ftp, 0);
|
|
||||||
|
|
||||||
/* Time to set our defaults */
|
/* Time to set our defaults */
|
||||||
ftpBinary (ftp);
|
ftpBinary (ftp);
|
||||||
ftpPassive (ftp, passive_mode);
|
ftpPassive (ftp, passive_mode);
|
||||||
|
Loading…
Reference in New Issue
Block a user