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