From: kstailey Date: Tue, 18 Feb 1997 18:04:28 +0000 (+0000) Subject: add -e command line option to suppress use of editline(3)\ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a2a87945aa4f70a9040d1b839c2b74389ce49402;p=openbsd add -e command line option to suppress use of editline(3)\ this is useful for Emacs ange-ftp --- diff --git a/usr.bin/ftp/ftp.1 b/usr.bin/ftp/ftp.1 index bb0c54b05cd..95af2319791 100644 --- a/usr.bin/ftp/ftp.1 +++ b/usr.bin/ftp/ftp.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ftp.1,v 1.7 1997/02/03 01:05:38 millert Exp $ +.\" $OpenBSD: ftp.1,v 1.8 1997/02/18 18:04:28 kstailey Exp $ .\" $NetBSD: ftp.1,v 1.17 1997/02/01 10:45:01 lukem Exp $ .\" .\" Copyright (c) 1985, 1989, 1990, 1993 @@ -46,6 +46,7 @@ file transfer program .Nm .Op Fl a .Op Fl d +.Op Fl e .Op Fl g .Op Fl i .Op Fl n @@ -83,6 +84,8 @@ Causes to bypass normal login procedure, and use an anonymous login instead. .It Fl d Enables debugging. +.It Fl e +Suppress the use of editline(3). Useful for Emacs ange-ftp. .It Fl g Disables file name globbing. .It Fl i diff --git a/usr.bin/ftp/ftp_var.h b/usr.bin/ftp/ftp_var.h index a9921b1f50f..50468d7891f 100644 --- a/usr.bin/ftp/ftp_var.h +++ b/usr.bin/ftp/ftp_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp_var.h,v 1.7 1997/02/03 01:05:41 millert Exp $ */ +/* $OpenBSD: ftp_var.h,v 1.8 1997/02/18 18:04:30 kstailey Exp $ */ /* $NetBSD: ftp_var.h,v 1.13 1997/02/01 10:45:05 lukem Exp $ */ /* @@ -68,6 +68,7 @@ int sendport; /* use PORT cmd for each data connection */ int verbose; /* print messages coming back from server */ int connected; /* connected to server */ int fromatty; /* input is from a terminal */ +int use_editline; /* use the editline(3) routine for input */ int interactive; /* interactively prompt on m* cmds */ int confirmrest; /* confirm rest of current m* cmd */ int debug; /* debugging level */ diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index bcac82b4f75..3771f115c0b 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.20 1997/02/05 04:55:19 millert Exp $ */ +/* $OpenBSD: main.c,v 1.21 1997/02/18 18:04:31 kstailey Exp $ */ /* $NetBSD: main.c,v 1.17 1997/02/01 10:45:07 lukem Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.20 1997/02/05 04:55:19 millert Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.21 1997/02/18 18:04:31 kstailey Exp $"; #endif #endif /* not lint */ @@ -94,6 +94,7 @@ main(argc, argv) progress = 0; mark = HASHBYTES; marg_sl = sl_init(); + use_editline = 1; /* use editline if possible */ cp = strrchr(argv[0], '/'); cp = (cp == NULL) ? argv[0] : cp + 1; @@ -104,7 +105,7 @@ main(argc, argv) if (fromatty) verbose = 1; /* verbose if from a tty */ - while ((ch = getopt(argc, argv, "adginpPr:tvV")) != -1) { + while ((ch = getopt(argc, argv, "adeginpPr:tvV")) != -1) { switch (ch) { case 'a': anonftp = 1; @@ -115,6 +116,10 @@ main(argc, argv) debug++; break; + case 'e': + use_editline = 0; + break; + case 'g': doglob = 0; break; @@ -185,7 +190,7 @@ main(argc, argv) #ifndef SMALLFTP editing = 0; /* command line editing off */ - if (fromatty) { + if (fromatty && use_editline) { editing = 1; /* editing mode on if a tty */ el = el_init(__progname, stdin, stdout); /* init editline */