-/* $OpenBSD: cmds.c,v 1.63 2008/07/08 21:07:57 martynas Exp $ */
+/* $OpenBSD: cmds.c,v 1.64 2008/08/22 08:52:35 sobrado Exp $ */
/* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */
/*
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: cmds.c,v 1.63 2008/07/08 21:07:57 martynas Exp $";
+static const char rcsid[] = "$OpenBSD: cmds.c,v 1.64 2008/08/22 08:52:35 sobrado Exp $";
#endif /* not lint and not SMALL */
/*
char *sep;
fprintf(ttyout, "usage: %s [", argv[0]);
- sep = " ";
+ sep = "";
for (p = types; p->t_name; p++) {
fprintf(ttyout, "%s%s", sep, p->t_name);
sep = " | ";
}
- fputs(" ]\n", ttyout);
+ fputs("]\n", ttyout);
code = -1;
return;
}
goto usage;
if ((argc < 3 && !another(&argc, &argv, "remote-file")) || argc > 3) {
usage:
- fprintf(ttyout, "usage: %s local-file [ remote-file ]\n", argv[0]);
+ fprintf(ttyout, "usage: %s local-file [remote-file]\n",
+ argv[0]);
code = -1;
return;
}
goto usage;
if ((argc < 3 && !another(&argc, &argv, "local-file")) || argc > 3) {
usage:
- fprintf(ttyout, "usage: %s remote-file [ local-file ]\n", argv[0]);
+ fprintf(ttyout, "usage: %s remote-file [local-file]\n",
+ argv[0]);
code = -1;
return (0);
}
} else if (argc == 2 && strcasecmp(argv[1], "off") == 0) {
*var = 0;
} else {
- fprintf(ttyout, "usage: %s [ on | off ]\n", argv[0]);
+ fprintf(ttyout, "usage: %s [on | off]\n", argv[0]);
return (-1);
}
if (mesg)
if (argc == 1)
hash = !hash;
else if (argc != 2) {
- fprintf(ttyout, "usage: %s [ on | off | bytecount ]\n", argv[0]);
+ fprintf(ttyout, "usage: %s [on | off | size]\n", argv[0]);
code = -1;
return;
} else if (strcasecmp(argv[1], "on") == 0)
static char gsbuf[MAXHOSTNAMELEN];
if (argc > 3) {
- fprintf(ttyout, "usage: %s [ on | off | gateserver [ port ] ]\n",
+ fprintf(ttyout, "usage: %s [on | off | host [port]]\n",
argv[0]);
code = -1;
return;
setdebug(int argc, char *argv[])
{
if (argc > 2) {
- fprintf(ttyout, "usage: %s [ on | off | debuglevel ]\n", argv[0]);
+ fprintf(ttyout, "usage: %s [on | off | debuglevel]\n", argv[0]);
code = -1;
return;
} else if (argc == 2) {
if (argc < 2)
argc++, argv[1] = home;
if (argc != 2) {
- fprintf(ttyout, "usage: %s local-directory\n", argv[0]);
+ fprintf(ttyout, "usage: %s [local-directory]\n", argv[0]);
code = -1;
return;
}
if (argc < 3)
argc++, argv[2] = "-";
if (argc > 3) {
- fprintf(ttyout, "usage: %s remote-directory local-file\n", argv[0]);
+ fprintf(ttyout, "usage: %s [remote-directory [local-file]]\n",
+ argv[0]);
code = -1;
return;
}
if (argc < 2)
(void)another(&argc, &argv, "username");
if (argc < 2 || argc > 4) {
- fprintf(ttyout, "usage: %s username [password] [account]\n", argv[0]);
+ fprintf(ttyout, "usage: %s username [password [account]]\n",
+ argv[0]);
code = -1;
return;
}
{
if (argc < 2 && !another(&argc, &argv, "command line to send")) {
- fprintf(ttyout, "usage: %s line-to-send\n", argv[0]);
+ fprintf(ttyout, "usage: %s arg ...\n", argv[0]);
code = -1;
return;
}
{
if (argc < 2 && !another(&argc, &argv, "arguments to SITE command")) {
- fprintf(ttyout, "usage: %s line-to-send\n", argv[0]);
+ fprintf(ttyout, "usage: %s arg ...\n", argv[0]);
code = -1;
return;
}
if (argc < 2 && !another(&argc, &argv, "mode"))
goto usage;
- if ((argc < 3 && !another(&argc, &argv, "file-name")) || argc > 3) {
+ if ((argc < 3 && !another(&argc, &argv, "file")) || argc > 3) {
usage:
- fprintf(ttyout, "usage: %s mode file-name\n", argv[0]);
+ fprintf(ttyout, "usage: %s mode file\n", argv[0]);
code = -1;
return;
}
code = mapflag;
return;
}
- if ((argc < 3 && !another(&argc, &argv, "mapout")) || argc > 3) {
- fprintf(ttyout, "usage: %s [mapin mapout]\n", argv[0]);
+ if ((argc < 3 && !another(&argc, &argv, "outpattern")) || argc > 3) {
+ fprintf(ttyout, "usage: %s [inpattern outpattern]\n", argv[0]);
code = -1;
return;
}
code = -1;
return;
}
- if ((argc < 2 && !another(&argc, &argv, "macro name")) || argc > 2) {
- fprintf(ttyout, "usage: %s macro_name\n", argv[0]);
+ if ((argc < 2 && !another(&argc, &argv, "macro-name")) || argc > 2) {
+ fprintf(ttyout, "usage: %s macro-name\n", argv[0]);
code = -1;
return;
}
{
off_t size;
- if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) {
- fprintf(ttyout, "usage: %s filename\n", argv[0]);
+ if ((argc < 2 && !another(&argc, &argv, "file")) || argc > 2) {
+ fprintf(ttyout, "usage: %s file\n", argv[0]);
code = -1;
return;
}
{
time_t mtime;
- if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) {
- fprintf(ttyout, "usage: %s filename\n", argv[0]);
+ if ((argc < 2 && !another(&argc, &argv, "file")) || argc > 2) {
+ fprintf(ttyout, "usage: %s file\n", argv[0]);
code = -1;
return;
}
int orestart_point, ohash, overbose;
char *p, *pager, *oldargv1;
- if ((argc < 2 && !another(&argc, &argv, "filename")) || argc > 2) {
- fprintf(ttyout, "usage: %s filename\n", argv[0]);
+ if ((argc < 2 && !another(&argc, &argv, "file")) || argc > 2) {
+ fprintf(ttyout, "usage: %s file\n", argv[0]);
code = -1;
return;
}
-/* $OpenBSD: domacro.c,v 1.13 2006/05/16 23:43:16 ray Exp $ */
+/* $OpenBSD: domacro.c,v 1.14 2008/08/22 08:52:35 sobrado Exp $ */
/* $NetBSD: domacro.c,v 1.10 1997/07/20 09:45:45 lukem Exp $ */
/*
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: domacro.c,v 1.13 2006/05/16 23:43:16 ray Exp $";
+static const char rcsid[] = "$OpenBSD: domacro.c,v 1.14 2008/08/22 08:52:35 sobrado Exp $";
#endif /* not lint and not SMALL */
#include <ctype.h>
struct cmd *c;
if (argc < 2 && !another(&argc, &argv, "macro name")) {
- fprintf(ttyout, "usage: %s macro_name\n", argv[0]);
+ fprintf(ttyout, "usage: %s macro-name\n", argv[0]);
code = -1;
return;
}
-.\" $OpenBSD: ftp.1,v 1.72 2008/07/16 14:57:27 martynas Exp $
+.\" $OpenBSD: ftp.1,v 1.73 2008/08/22 08:52:35 sobrado Exp $
.\" $NetBSD: ftp.1,v 1.22 1997/08/18 10:20:22 lukem Exp $
.\"
.\" Copyright (c) 1985, 1989, 1990, 1993
.\"
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
.\"
-.Dd $Mdocdate: July 16 2008 $
+.Dd $Mdocdate: August 22 2008 $
.Dt FTP 1
.Os
.Sh NAME
by
.Nm :
.Bl -tag -width Fl
-.It Ic \&! Op Ar command Op Ar args
+.It Ic \&! Oo Ar command
+.Op Ar arg ...
+.Oc
Invoke an interactive shell on the local machine.
If there are arguments, the first is taken to be a command to execute
directly, with the rest of the arguments as its arguments.
-.It Ic \&$ Ar macro-name Op Ar args
+.It Ic \&$ Ar macro-name Op Ar arg ...
Execute the macro
.Ar macro-name
that was defined with the
.It Ic \&? Op Ar command
A synonym for
.Ic help .
-.It Ic account Op Ar passwd
+.It Ic account Op Ar password
Supply a supplemental password required by a remote system for access
to resources once a login has been successfully completed.
If no argument is included, the user will be prompted for an account
.Ic type
to network
.Tn ASCII .
-This is the default type.
-.It Ic bell
+.It Ic bell Op Ic on | off
Arrange that a bell be sounded after each file transfer
command is completed.
.It Ic binary
Set the file transfer
.Ic type
to support binary image transfer.
+This is the default type.
.It Ic bye
Terminate the FTP session with the remote server and exit
.Nm .
An end-of-file will also terminate the session and exit.
-.It Ic case
+.It Ic case Op Ic on | off
Toggle remote computer file name case mapping during
.Ic mget
commands.
.It Ic cdup
Change the remote machine working directory to the parent of the
current remote machine working directory.
-.It Ic chmod Ar mode file-name
-Change the permission modes of the file
-.Ar file-name
+.It Ic chmod Ar mode file
+Change the permission modes of
+.Ar file
on the remote
system to
.Ar mode .
Terminate the FTP session with the remote server and
return to the command interpreter.
Any defined macros are erased.
-.It Ic cr
+.It Ic cr Op Ic on | off
Toggle carriage return stripping during
ASCII type file retrieval.
Records are denoted by a carriage return/linefeed sequence
distinguished from a record delimiter only when
.Ic cr
is off.
-.It Ic debug Op Ar debug-value
+.It Ic debug Oo Ic on | off |
+.Ar debuglevel
+.Oc
Toggle debugging mode.
If an optional
-.Ar debug-value
+.Ar debuglevel
is specified, it is used to set the debugging level.
When debugging is on,
.Nm
.It Ic disconnect
A synonym for
.Ic close .
-.It Ic edit
+.It Ic edit Op Ic on | off
Toggle command line editing, and context sensitive command and file
completion.
This is automatically enabled if input is from a terminal, and
disabled otherwise.
-.It Ic epsv4
+.It Ic epsv4 Op Ic on | off
Toggle use of EPSV/EPRT command on IPv4 connection.
.It Ic exit
A synonym for
.It Ic ftp Ar host Op Ar port
A synonym for
.Ic open .
-.It Ic gate Op Ar host Op Ar port
+.It Ic gate Oo Ic on | off |
+.Ar host Op Ar port
+.Oc
Toggle gate-ftp mode.
This will not be permitted if the gate-ftp server hasn't been set
(either explicitly by the user, or from the
and
.Ic structure
are used while transferring the file.
-.It Ic glob
+.It Ic glob Op Ic on | off
Toggle filename expansion for
.Ic mdelete ,
.Ic mget
transferring a
.Xr tar 1
archive of the subtree (in binary mode).
-.It Ic hash Op Ar size
+.It Ic hash Oo Ic on | off |
+.Ar size
+.Oc
Toggle hash mark
.Pq Ql #
printing for each data block transferred.
If
.Ar seconds
is omitted, the current inactivity timer is printed.
-.It Ic lcd Op Ar directory
+.It Ic lcd Op Ar local-directory
Change the working directory on the local machine.
If
no
-.Ar directory
+.Ar local-directory
is specified, the user's home directory is used.
.It Ic less Ar file
A synonym for
The default mode is
.Dq stream
mode.
-.It Ic modtime Ar file-name
-Show the last modification time of the file on the remote machine.
+.It Ic modtime Ar file
+Show the last modification time of
+.Ar file
+on the remote machine.
.It Ic more Ar file
A synonym for
.Ic page .
.Ic reput
is used instead of
.Ic put .
-.It Ic msend Ar local-files
+.It Xo Ic msend
+.Op Fl c
+.Ar local-files
+.Xc
A synonym for
.Ic mput .
-.It Ic newer Ar file-name
+.It Ic newer Ar remote-file Op Ar local-file
Get the file only if the modification time of the remote file is more
recent than the file on the current system.
If the file does not
if
.Ev PAGER
is null or not defined).
-.It Ic passive
+.It Ic passive Op Ic on | off
Toggle passive mode.
If passive mode is turned on (default is on),
.Nm
(Note that though FTP servers are required to support the
.Dv PASV
command by RFC 1123, some do not.)
-.It Ic preserve
+.It Ic preserve Op Ic on | off
Toggle preservation of modification times on retrieved files.
-.It Ic progress
+.It Ic progress Op Ic on | off
Toggle display of transfer progress bar.
The progress bar will be disabled for a transfer that has
.Ar local-file
Refer to
.Sx FILE NAMING CONVENTIONS
for more information.
-.It Ic prompt
+.It Ic prompt Op Ic on | off
Toggle interactive prompting.
Interactive prompting
occurs during multiple file transfers to allow the
.It Ic y
Transfer the file.
.El
-.It Ic proxy Ar ftp-command
+.It Ic proxy Ar command
Execute an FTP command on a secondary control connection.
This command allows simultaneous connection to two remote FTP
servers for transferring files between the two servers.
.It Ic quit
A synonym for
.Ic bye .
-.It Ic quote Ar arg1 arg2 ...
+.It Ic quote Ar arg ...
The arguments specified are sent, verbatim, to the remote FTP server.
.It Ic recv Ar remote-file Op Ar local-file
A synonym for
This command
is useful when transferring very large files over networks that
are prone to dropping connections.
-.It Ic rename Op Ar from Op Ar to
+.It Ic rename Ar from-name to-name
Rename the file
-.Ar from
+.Ar from-name
on the remote machine to the file
-.Ar to .
+.Ar to-name .
.It Ic reput Ar local-file Op Ar remote-file
Reput acts like put, except that if
.Ar remote-file
is specified, it is supplied to the server as well.
.It Ic rmdir Ar directory-name
Delete a directory on the remote machine.
-.It Ic rstatus Op Ar file-name
+.It Ic rstatus Op Ar file
With no arguments, show status of remote machine.
If
-.Ar file-name
+.Ar file
is specified, show status of
-.Ar file-name
+.Ar file
on remote machine.
-.It Ic runique
+.It Ic runique Op Ic on | off
Toggle storing of files on the local system with unique filenames.
If a file already exists with a name equal to the target
local filename for a
.It Ic send Ar local-file Op Ar remote-file
A synonym for
.Ic put .
-.It Ic sendport
+.It Ic sendport Op Ic on | off
Toggle the use of
.Dv PORT
commands.
This is useful for certain FTP implementations which do ignore
.Dv PORT
commands but, incorrectly, indicate they've been accepted.
-.It Ic site Ar arg1 arg2 ...
+.It Ic site Ar arg ...
The arguments specified are sent, verbatim, to the remote FTP server as a
.Dv SITE
command.
-.It Ic size Ar file-name
+.It Ic size Ar file
Return size of
-.Ar file-name
+.Ar file
on remote machine.
.It Ic status
Show the current status of
.\" By default,
.\" .Dq file
.\" structure is used.
-.It Ic sunique
+.It Ic sunique Op Ic on | off
Toggle storing of files on remote machine under unique file names.
The remote FTP server must support the FTP protocol
.Dv STOU
talk to
.Tn TENEX
machines.
-.It Ic trace
+.It Ic trace Op Ic on | off
Toggle packet tracing.
.It Ic type Op Ar type-name
Set the file transfer
.Ar newmask
is omitted, the current umask is printed.
.It Xo
-.Ic user Ar user-name
+.Ic user Ar username
.Op Ar password Op Ar account
.Xc
Identify yourself to the remote FTP server.
.Dq auto-login
disabled, this process is done automatically on initial connection to the
FTP server.
-.It Ic verbose
+.It Ic verbose Op Ic on | off
Toggle verbose mode.
In verbose mode, all responses from
the FTP server are displayed to the user.
-/* $OpenBSD: main.c,v 1.70 2008/07/08 21:07:57 martynas Exp $ */
+/* $OpenBSD: main.c,v 1.71 2008/08/22 08:52:35 sobrado Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
#endif /* not lint */
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: main.c,v 1.70 2008/07/08 21:07:57 martynas Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.71 2008/08/22 08:52:35 sobrado Exp $";
#endif /* not lint and not SMALL */
/*
#ifndef SMALL
"[-C] "
#endif /* !SMALL */
- "[-o output] host:[/path/]file[/]\n",
+ "[-o output] host:/file[/]\n",
#ifndef SMALL
__progname, __progname, __progname, __progname, __progname);
#else /* !SMALL */
-/* $OpenBSD: util.c,v 1.54 2008/07/08 21:07:57 martynas Exp $ */
+/* $OpenBSD: util.c,v 1.55 2008/08/22 08:52:35 sobrado Exp $ */
/* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */
/*-
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: util.c,v 1.54 2008/07/08 21:07:57 martynas Exp $";
+static const char rcsid[] = "$OpenBSD: util.c,v 1.55 2008/08/22 08:52:35 sobrado Exp $";
#endif /* not lint and not SMALL */
/*
if (argc < 2)
(void)another(&argc, &argv, "to");
if (argc < 2 || argc > 3) {
- fprintf(ttyout, "usage: %s host-name [port]\n", argv[0]);
+ fprintf(ttyout, "usage: %s host [port]\n", argv[0]);
code = -1;
return;
}