Home | History | Annotate | Line # | Download | only in ftp
cmdtab.c revision 1.45
      1  1.45     lukem /*	$NetBSD: cmdtab.c,v 1.45 2005/06/09 16:38:29 lukem Exp $	*/
      2  1.31     lukem 
      3  1.31     lukem /*-
      4  1.45     lukem  * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
      5  1.31     lukem  * All rights reserved.
      6  1.31     lukem  *
      7  1.31     lukem  * This code is derived from software contributed to The NetBSD Foundation
      8  1.31     lukem  * by Luke Mewburn.
      9  1.31     lukem  *
     10  1.31     lukem  * Redistribution and use in source and binary forms, with or without
     11  1.31     lukem  * modification, are permitted provided that the following conditions
     12  1.31     lukem  * are met:
     13  1.31     lukem  * 1. Redistributions of source code must retain the above copyright
     14  1.31     lukem  *    notice, this list of conditions and the following disclaimer.
     15  1.31     lukem  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.31     lukem  *    notice, this list of conditions and the following disclaimer in the
     17  1.31     lukem  *    documentation and/or other materials provided with the distribution.
     18  1.31     lukem  * 3. All advertising materials mentioning features or use of this software
     19  1.31     lukem  *    must display the following acknowledgement:
     20  1.31     lukem  *	This product includes software developed by the NetBSD
     21  1.31     lukem  *	Foundation, Inc. and its contributors.
     22  1.31     lukem  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.31     lukem  *    contributors may be used to endorse or promote products derived
     24  1.31     lukem  *    from this software without specific prior written permission.
     25  1.31     lukem  *
     26  1.31     lukem  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.31     lukem  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.31     lukem  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.31     lukem  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.31     lukem  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.31     lukem  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.31     lukem  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.31     lukem  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.31     lukem  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.31     lukem  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.31     lukem  * POSSIBILITY OF SUCH DAMAGE.
     37  1.31     lukem  */
     38   1.6       tls 
     39   1.1       cgd /*
     40   1.3       cgd  * Copyright (c) 1985, 1989, 1993, 1994
     41   1.3       cgd  *	The Regents of the University of California.  All rights reserved.
     42   1.1       cgd  *
     43   1.1       cgd  * Redistribution and use in source and binary forms, with or without
     44   1.1       cgd  * modification, are permitted provided that the following conditions
     45   1.1       cgd  * are met:
     46   1.1       cgd  * 1. Redistributions of source code must retain the above copyright
     47   1.1       cgd  *    notice, this list of conditions and the following disclaimer.
     48   1.1       cgd  * 2. Redistributions in binary form must reproduce the above copyright
     49   1.1       cgd  *    notice, this list of conditions and the following disclaimer in the
     50   1.1       cgd  *    documentation and/or other materials provided with the distribution.
     51  1.41       agc  * 3. Neither the name of the University nor the names of its contributors
     52   1.1       cgd  *    may be used to endorse or promote products derived from this software
     53   1.1       cgd  *    without specific prior written permission.
     54   1.1       cgd  *
     55   1.1       cgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     56   1.1       cgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     57   1.1       cgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     58   1.1       cgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     59   1.1       cgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     60   1.1       cgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     61   1.1       cgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     62   1.1       cgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     63   1.1       cgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     64   1.1       cgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     65   1.1       cgd  * SUCH DAMAGE.
     66   1.1       cgd  */
     67   1.1       cgd 
     68  1.16     lukem #include <sys/cdefs.h>
     69   1.1       cgd #ifndef lint
     70   1.6       tls #if 0
     71   1.6       tls static char sccsid[] = "@(#)cmdtab.c	8.4 (Berkeley) 10/9/94";
     72   1.6       tls #else
     73  1.45     lukem __RCSID("$NetBSD: cmdtab.c,v 1.45 2005/06/09 16:38:29 lukem Exp $");
     74   1.6       tls #endif
     75   1.1       cgd #endif /* not lint */
     76   1.1       cgd 
     77   1.3       cgd #include <stdio.h>
     78   1.1       cgd #include "ftp_var.h"
     79   1.1       cgd 
     80   1.1       cgd /*
     81   1.1       cgd  * User FTP -- Command Tables.
     82   1.1       cgd  */
     83   1.1       cgd 
     84  1.42  christos #define HSTR	static const char
     85  1.42  christos 
     86  1.42  christos #ifndef NO_HELP
     87  1.42  christos HSTR	accounthelp[] =	"send account command to remote server";
     88  1.42  christos HSTR	appendhelp[] =	"append to a file";
     89  1.42  christos HSTR	asciihelp[] =	"set ascii transfer type";
     90  1.42  christos HSTR	beephelp[] =	"beep when command completed";
     91  1.42  christos HSTR	binaryhelp[] =	"set binary transfer type";
     92  1.42  christos HSTR	casehelp[] =	"toggle mget upper/lower case id mapping";
     93  1.42  christos HSTR	cdhelp[] =	"change remote working directory";
     94  1.42  christos HSTR	cduphelp[] =	"change remote working directory to parent directory";
     95  1.42  christos HSTR	chmodhelp[] =	"change file permissions of remote file";
     96  1.42  christos HSTR	connecthelp[] =	"connect to remote ftp server";
     97  1.42  christos HSTR	crhelp[] =	"toggle carriage return stripping on ascii gets";
     98  1.42  christos HSTR	debughelp[] =	"toggle/set debugging mode";
     99  1.42  christos HSTR	deletehelp[] =	"delete remote file";
    100  1.42  christos HSTR	disconhelp[] =	"terminate ftp session";
    101  1.42  christos HSTR	domachelp[] =	"execute macro";
    102  1.42  christos HSTR	edithelp[] =	"toggle command line editing";
    103  1.42  christos HSTR	epsv4help[] =	"toggle use of EPSV/EPRT on IPv4 ftp";
    104  1.42  christos HSTR	feathelp[] =	"show FEATures supported by remote system";
    105  1.42  christos HSTR	formhelp[] =	"set file transfer format";
    106  1.42  christos HSTR	gatehelp[] =	"toggle gate-ftp; specify host[:port] to change proxy";
    107  1.42  christos HSTR	globhelp[] =	"toggle metacharacter expansion of local file names";
    108  1.42  christos HSTR	hashhelp[] =	"toggle printing `#' marks; specify number to set size";
    109  1.42  christos HSTR	helphelp[] =	"print local help information";
    110  1.42  christos HSTR	idlehelp[] =	"get (set) idle timer on remote side";
    111  1.42  christos HSTR	lcdhelp[] =	"change local working directory";
    112  1.42  christos HSTR	lpagehelp[] =	"view a local file through your pager";
    113  1.42  christos HSTR	lpwdhelp[] =	"print local working directory";
    114  1.42  christos HSTR	lshelp[] =	"list contents of remote path";
    115  1.42  christos HSTR	macdefhelp[] =  "define a macro";
    116  1.42  christos HSTR	mdeletehelp[] =	"delete multiple files";
    117  1.42  christos HSTR	mgethelp[] =	"get multiple files";
    118  1.42  christos HSTR	mregethelp[] =	"get multiple files restarting at end of local file";
    119  1.42  christos HSTR	fgethelp[] =	"get files using a localfile as a source of names";
    120  1.42  christos HSTR	mkdirhelp[] =	"make directory on the remote machine";
    121  1.42  christos HSTR	mlshelp[] =	"list contents of multiple remote directories";
    122  1.42  christos HSTR	mlsdhelp[] =	"list contents of remote directory in a machine "
    123  1.36     lukem 			"parsable form";
    124  1.42  christos HSTR	mlsthelp[] =	"list remote path in a machine parsable form";
    125  1.42  christos HSTR	modehelp[] =	"set file transfer mode";
    126  1.42  christos HSTR	modtimehelp[] = "show last modification time of remote file";
    127  1.42  christos HSTR	mputhelp[] =	"send multiple files";
    128  1.42  christos HSTR	newerhelp[] =	"get file if remote file is newer than local file ";
    129  1.42  christos HSTR	nmaphelp[] =	"set templates for default file name mapping";
    130  1.42  christos HSTR	ntranshelp[] =	"set translation table for default file name mapping";
    131  1.42  christos HSTR	optshelp[] =	"show or set options for remote commands";
    132  1.42  christos HSTR	pagehelp[] =	"view a remote file through your pager";
    133  1.42  christos HSTR	passivehelp[] =	"toggle use of passive transfer mode";
    134  1.42  christos HSTR	plshelp[] =	"list contents of remote path through your pager";
    135  1.42  christos HSTR	pmlsdhelp[] =	"list contents of remote directory in a machine "
    136  1.36     lukem 			"parsable form through your pager";
    137  1.42  christos HSTR	porthelp[] =	"toggle use of PORT/LPRT cmd for each data connection";
    138  1.42  christos HSTR	preservehelp[] ="toggle preservation of modification time of "
    139  1.19     lukem 			"retrieved files";
    140  1.42  christos HSTR	progresshelp[] ="toggle transfer progress meter";
    141  1.42  christos HSTR	prompthelp[] =	"force interactive prompting on multiple commands";
    142  1.42  christos HSTR	proxyhelp[] =	"issue command on alternate connection";
    143  1.42  christos HSTR	pwdhelp[] =	"print working directory on remote machine";
    144  1.42  christos HSTR	quithelp[] =	"terminate ftp session and exit";
    145  1.42  christos HSTR	quotehelp[] =	"send arbitrary ftp command";
    146  1.42  christos HSTR	ratehelp[] =	"set transfer rate limit (in bytes/second)";
    147  1.42  christos HSTR	receivehelp[] =	"receive file";
    148  1.42  christos HSTR	regethelp[] =	"get file restarting at end of local file";
    149  1.42  christos HSTR	remotehelp[] =	"get help from remote server";
    150  1.42  christos HSTR	renamehelp[] =	"rename file";
    151  1.42  christos HSTR	resethelp[] =	"clear queued command replies";
    152  1.42  christos HSTR	restarthelp[]=	"restart file transfer at bytecount";
    153  1.42  christos HSTR	rmdirhelp[] =	"remove directory on the remote machine";
    154  1.42  christos HSTR	rmtstatushelp[]="show status of remote machine";
    155  1.42  christos HSTR	runiquehelp[] = "toggle store unique for local files";
    156  1.42  christos HSTR	sendhelp[] =	"send one file";
    157  1.42  christos HSTR	sethelp[] =	"set or display options";
    158  1.42  christos HSTR	shellhelp[] =	"escape to the shell";
    159  1.42  christos HSTR	sitehelp[] =	"send site specific command to remote server\n"
    160  1.10     lukem 			"\t\tTry \"rhelp site\" or \"site help\" "
    161  1.10     lukem 			"for more information";
    162  1.42  christos HSTR	sizecmdhelp[] = "show size of remote file";
    163  1.42  christos HSTR	statushelp[] =	"show current status";
    164  1.42  christos HSTR	structhelp[] =	"set file transfer structure";
    165  1.42  christos HSTR	suniquehelp[] = "toggle store unique on remote machine";
    166  1.42  christos HSTR	systemhelp[] =  "show remote system type";
    167  1.42  christos HSTR	tenexhelp[] =	"set tenex file transfer type";
    168  1.42  christos HSTR	tracehelp[] =	"toggle packet tracing";
    169  1.42  christos HSTR	typehelp[] =	"set file transfer type";
    170  1.42  christos HSTR	umaskhelp[] =	"get (set) umask on remote side";
    171  1.42  christos HSTR	unsethelp[] =	"unset an option";
    172  1.42  christos HSTR	usagehelp[] =	"show command usage";
    173  1.42  christos HSTR	userhelp[] =	"send new user information";
    174  1.42  christos HSTR	verbosehelp[] =	"toggle verbose mode";
    175  1.42  christos HSTR	xferbufhelp[] =	"set socket send/receive buffer size";
    176  1.42  christos #endif
    177  1.42  christos 
    178  1.42  christos HSTR	empty[] = "";
    179  1.42  christos 
    180  1.42  christos #ifdef NO_HELP
    181  1.42  christos #define H(x)	empty
    182  1.42  christos #else
    183  1.42  christos #define H(x)	x
    184  1.42  christos #endif
    185   1.1       cgd 
    186  1.21       cgd #ifdef NO_EDITCOMPLETE
    187  1.32     lukem #define	CMPL(x)
    188  1.32     lukem #define	CMPL0
    189  1.21       cgd #else  /* !NO_EDITCOMPLETE */
    190  1.38     lukem #define	CMPL(x)	#x,
    191  1.44     lukem #define	CMPL0	empty,
    192  1.21       cgd #endif /* !NO_EDITCOMPLETE */
    193  1.12     lukem 
    194   1.1       cgd struct cmd cmdtab[] = {
    195  1.42  christos 	{ "!",		H(shellhelp),	0, 0, 0, CMPL0		shell },
    196  1.42  christos 	{ "$",		H(domachelp),	1, 0, 0, CMPL0		domacro },
    197  1.42  christos 	{ "account",	H(accounthelp),	0, 1, 1, CMPL0		account},
    198  1.42  christos 	{ "append",	H(appendhelp),	1, 1, 1, CMPL(lr)	put },
    199  1.42  christos 	{ "ascii",	H(asciihelp),	0, 1, 1, CMPL0		setascii },
    200  1.42  christos 	{ "bell",	H(beephelp),	0, 0, 0, CMPL0		setbell },
    201  1.42  christos 	{ "binary",	H(binaryhelp),	0, 1, 1, CMPL0		setbinary },
    202  1.42  christos 	{ "bye",	H(quithelp),	0, 0, 0, CMPL0		quit },
    203  1.42  christos 	{ "case",	H(casehelp),	0, 0, 1, CMPL0		setcase },
    204  1.42  christos 	{ "cd",		H(cdhelp),	0, 1, 1, CMPL(r)	cd },
    205  1.42  christos 	{ "cdup",	H(cduphelp),	0, 1, 1, CMPL0		cdup },
    206  1.42  christos 	{ "chmod",	H(chmodhelp),	0, 1, 1, CMPL(nr)	do_chmod },
    207  1.42  christos 	{ "close",	H(disconhelp),	0, 1, 1, CMPL0		disconnect },
    208  1.42  christos 	{ "cr",		H(crhelp),	0, 0, 0, CMPL0		setcr },
    209  1.42  christos 	{ "debug",	H(debughelp),	0, 0, 0, CMPL0		setdebug },
    210  1.42  christos 	{ "delete",	H(deletehelp),	0, 1, 1, CMPL(r)	delete },
    211  1.42  christos 	{ "dir",	H(lshelp),	1, 1, 1, CMPL(rl)	ls },
    212  1.42  christos 	{ "disconnect",	H(disconhelp),	0, 1, 1, CMPL0		disconnect },
    213  1.42  christos 	{ "edit",	H(edithelp),	0, 0, 0, CMPL0		setedit },
    214  1.42  christos 	{ "epsv4",	H(epsv4help),	0, 0, 0, CMPL0		setepsv4 },
    215  1.42  christos 	{ "exit",	H(quithelp),	0, 0, 0, CMPL0		quit },
    216  1.42  christos 	{ "features",	H(feathelp),	0, 1, 1, CMPL0		feat },
    217  1.42  christos 	{ "fget",	H(fgethelp),	1, 1, 1, CMPL(l)	fget },
    218  1.42  christos 	{ "form",	H(formhelp),	0, 1, 1, CMPL0		setform },
    219  1.42  christos 	{ "ftp",	H(connecthelp),	0, 0, 1, CMPL0		setpeer },
    220  1.42  christos 	{ "gate",	H(gatehelp),	0, 0, 0, CMPL0		setgate },
    221  1.42  christos 	{ "get",	H(receivehelp),	1, 1, 1, CMPL(rl)	get },
    222  1.42  christos 	{ "glob",	H(globhelp),	0, 0, 0, CMPL0		setglob },
    223  1.42  christos 	{ "hash",	H(hashhelp),	0, 0, 0, CMPL0		sethash },
    224  1.43     lukem 	{ "help",	H(helphelp),	0, 0, 1, CMPL(C)	help },
    225  1.42  christos 	{ "idle",	H(idlehelp),	0, 1, 1, CMPL0		idlecmd },
    226  1.42  christos 	{ "image",	H(binaryhelp),	0, 1, 1, CMPL0		setbinary },
    227  1.42  christos 	{ "lcd",	H(lcdhelp),	0, 0, 0, CMPL(l)	lcd },
    228  1.42  christos 	{ "less",	H(pagehelp),	1, 1, 1, CMPL(r)	page },
    229  1.42  christos 	{ "lpage",	H(lpagehelp),	0, 0, 0, CMPL(l)	lpage },
    230  1.42  christos 	{ "lpwd",	H(lpwdhelp),	0, 0, 0, CMPL0		lpwd },
    231  1.42  christos 	{ "ls",		H(lshelp),	1, 1, 1, CMPL(rl)	ls },
    232  1.42  christos 	{ "macdef",	H(macdefhelp),	0, 0, 0, CMPL0		macdef },
    233  1.42  christos 	{ "mdelete",	H(mdeletehelp),	1, 1, 1, CMPL(R)	mdelete },
    234  1.42  christos 	{ "mdir",	H(mlshelp),	1, 1, 1, CMPL(R)	mls },
    235  1.42  christos 	{ "mget",	H(mgethelp),	1, 1, 1, CMPL(R)	mget },
    236  1.42  christos 	{ "mkdir",	H(mkdirhelp),	0, 1, 1, CMPL(r)	makedir },
    237  1.42  christos 	{ "mls",	H(mlshelp),	1, 1, 1, CMPL(R)	mls },
    238  1.42  christos 	{ "mlsd",	H(mlsdhelp),	1, 1, 1, CMPL(r)	ls },
    239  1.42  christos 	{ "mlst",	H(mlsthelp),	1, 1, 1, CMPL(r)	mlst },
    240  1.42  christos 	{ "mode",	H(modehelp),	0, 1, 1, CMPL0		setftmode },
    241  1.42  christos 	{ "modtime",	H(modtimehelp),	0, 1, 1, CMPL(r)	modtime },
    242  1.42  christos 	{ "more",	H(pagehelp),	1, 1, 1, CMPL(r)	page },
    243  1.42  christos 	{ "mput",	H(mputhelp),	1, 1, 1, CMPL(L)	mput },
    244  1.42  christos 	{ "mreget",	H(mregethelp),	1, 1, 1, CMPL(R)	mget },
    245  1.42  christos 	{ "msend",	H(mputhelp),	1, 1, 1, CMPL(L)	mput },
    246  1.42  christos 	{ "newer",	H(newerhelp),	1, 1, 1, CMPL(r)	newer },
    247  1.42  christos 	{ "nlist",	H(lshelp),	1, 1, 1, CMPL(rl)	ls },
    248  1.42  christos 	{ "nmap",	H(nmaphelp),	0, 0, 1, CMPL0		setnmap },
    249  1.42  christos 	{ "ntrans",	H(ntranshelp),	0, 0, 1, CMPL0		setntrans },
    250  1.42  christos 	{ "open",	H(connecthelp),	0, 0, 1, CMPL0		setpeer },
    251  1.42  christos 	{ "page",	H(pagehelp),	1, 1, 1, CMPL(r)	page },
    252  1.42  christos 	{ "passive",	H(passivehelp),	0, 0, 0, CMPL0		setpassive },
    253  1.42  christos 	{ "pdir",	H(plshelp),	1, 1, 1, CMPL(r)	ls },
    254  1.42  christos 	{ "pls",	H(plshelp),	1, 1, 1, CMPL(r)	ls },
    255  1.42  christos 	{ "pmlsd",	H(pmlsdhelp),	1, 1, 1, CMPL(r)	ls },
    256  1.42  christos 	{ "preserve",	H(preservehelp),0, 0, 0, CMPL0		setpreserve },
    257  1.42  christos 	{ "progress",	H(progresshelp),0, 0, 0, CMPL0		setprogress },
    258  1.42  christos 	{ "prompt",	H(prompthelp),	0, 0, 0, CMPL0		setprompt },
    259  1.42  christos 	{ "proxy",	H(proxyhelp),	0, 0, 1, CMPL(c)	doproxy },
    260  1.42  christos 	{ "put",	H(sendhelp),	1, 1, 1, CMPL(lr)	put },
    261  1.42  christos 	{ "pwd",	H(pwdhelp),	0, 1, 1, CMPL0		pwd },
    262  1.42  christos 	{ "quit",	H(quithelp),	0, 0, 0, CMPL0		quit },
    263  1.42  christos 	{ "quote",	H(quotehelp),	1, 1, 1, CMPL0		quote },
    264  1.42  christos 	{ "rate",	H(ratehelp),	0, 0, 0, CMPL0		setrate },
    265  1.42  christos 	{ "rcvbuf",	H(xferbufhelp),	0, 0, 0, CMPL0		setxferbuf },
    266  1.42  christos 	{ "recv",	H(receivehelp),	1, 1, 1, CMPL(rl)	get },
    267  1.42  christos 	{ "reget",	H(regethelp),	1, 1, 1, CMPL(rl)	reget },
    268  1.42  christos 	{ "remopts",	H(optshelp),	0, 1, 1, CMPL0		opts },
    269  1.42  christos 	{ "rename",	H(renamehelp),	0, 1, 1, CMPL(rr)	renamefile },
    270  1.42  christos 	{ "reset",	H(resethelp),	0, 1, 1, CMPL0		reset },
    271  1.42  christos 	{ "restart",	H(restarthelp),	1, 1, 1, CMPL0		restart },
    272  1.43     lukem 	{ "rhelp",	H(remotehelp),	0, 1, 1, CMPL0		rmthelp },
    273  1.42  christos 	{ "rmdir",	H(rmdirhelp),	0, 1, 1, CMPL(r)	removedir },
    274  1.42  christos 	{ "rstatus",	H(rmtstatushelp),0, 1, 1, CMPL(r)	rmtstatus },
    275  1.42  christos 	{ "runique",	H(runiquehelp),	0, 0, 1, CMPL0		setrunique },
    276  1.42  christos 	{ "send",	H(sendhelp),	1, 1, 1, CMPL(lr)	put },
    277  1.42  christos 	{ "sendport",	H(porthelp),	0, 0, 0, CMPL0		setport },
    278  1.42  christos 	{ "set",	H(sethelp),	0, 0, 0, CMPL(o)	setoption },
    279  1.42  christos 	{ "site",	H(sitehelp),	0, 1, 1, CMPL0		site },
    280  1.42  christos 	{ "size",	H(sizecmdhelp),	1, 1, 1, CMPL(r)	sizecmd },
    281  1.42  christos 	{ "sndbuf",	H(xferbufhelp),	0, 0, 0, CMPL0		setxferbuf },
    282  1.42  christos 	{ "status",	H(statushelp),	0, 0, 1, CMPL0		status },
    283  1.42  christos 	{ "struct",	H(structhelp),	0, 1, 1, CMPL0		setstruct },
    284  1.42  christos 	{ "sunique",	H(suniquehelp),	0, 0, 1, CMPL0		setsunique },
    285  1.42  christos 	{ "system",	H(systemhelp),	0, 1, 1, CMPL0		syst },
    286  1.42  christos 	{ "tenex",	H(tenexhelp),	0, 1, 1, CMPL0		settenex },
    287  1.42  christos 	{ "throttle",	H(ratehelp),	0, 0, 0, CMPL0		setrate },
    288  1.42  christos 	{ "trace",	H(tracehelp),	0, 0, 0, CMPL0		settrace },
    289  1.42  christos 	{ "type",	H(typehelp),	0, 1, 1, CMPL0		settype },
    290  1.42  christos 	{ "umask",	H(umaskhelp),	0, 1, 1, CMPL0		do_umask },
    291  1.42  christos 	{ "unset",	H(unsethelp),	0, 0, 0, CMPL(o)	unsetoption },
    292  1.42  christos 	{ "usage",	H(usagehelp),	0, 0, 1, CMPL(C)	help },
    293  1.42  christos 	{ "user",	H(userhelp),	0, 1, 1, CMPL0		user },
    294  1.42  christos 	{ "verbose",	H(verbosehelp),	0, 0, 0, CMPL0		setverbose },
    295  1.42  christos 	{ "xferbuf",	H(xferbufhelp),	0, 0, 0, CMPL0		setxferbuf },
    296  1.42  christos 	{ "?",		H(helphelp),	0, 0, 1, CMPL(C)	help },
    297   1.1       cgd 	{ 0 },
    298   1.1       cgd };
    299   1.1       cgd 
    300  1.32     lukem struct option optiontab[] = {
    301  1.32     lukem 	{ "anonpass",	NULL },
    302  1.32     lukem 	{ "ftp_proxy",	NULL },
    303  1.32     lukem 	{ "http_proxy",	NULL },
    304  1.32     lukem 	{ "no_proxy",	NULL },
    305  1.32     lukem 	{ "pager",	NULL },
    306  1.33     lukem 	{ "prompt",	NULL },
    307  1.34     lukem 	{ "rprompt",	NULL },
    308  1.32     lukem 	{ 0 },
    309  1.32     lukem };
    310