version 1.4, 1996/12/01 05:27:22 |
version 1.5, 1997/02/03 01:02:34 |
|
|
/* $OpenBSD$ */ |
/* $NetBSD: cmdtab.c,v 1.12 1997/01/19 14:19:05 lukem Exp $ */ |
/* $NetBSD: cmdtab.c,v 1.6 1995/09/08 01:06:10 tls Exp $ */ |
|
|
|
/* |
/* |
* Copyright (c) 1985, 1989, 1993, 1994 |
* Copyright (c) 1985, 1989, 1993, 1994 |
|
|
#if 0 |
#if 0 |
static char sccsid[] = "@(#)cmdtab.c 8.4 (Berkeley) 10/9/94"; |
static char sccsid[] = "@(#)cmdtab.c 8.4 (Berkeley) 10/9/94"; |
#else |
#else |
static char rcsid[] = "$OpenBSD$"; |
static char rcsid[] = "$NetBSD: cmdtab.c,v 1.12 1997/01/19 14:19:05 lukem Exp $"; |
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
|
char binaryhelp[] = "set binary transfer type"; |
char binaryhelp[] = "set binary transfer type"; |
char casehelp[] = "toggle mget upper/lower case id mapping"; |
char casehelp[] = "toggle mget upper/lower case id mapping"; |
char cdhelp[] = "change remote working directory"; |
char cdhelp[] = "change remote working directory"; |
char cduphelp[] = "change remote working directory to parent directory"; |
char cduphelp[] = "change remote working directory to parent directory"; |
char chmodhelp[] = "change file permissions of remote file"; |
char chmodhelp[] = "change file permissions of remote file"; |
char connecthelp[] = "connect to remote ftp"; |
char connecthelp[] = "connect to remote ftp server"; |
char crhelp[] = "toggle carriage return stripping on ascii gets"; |
char crhelp[] = "toggle carriage return stripping on ascii gets"; |
char deletehelp[] = "delete remote file"; |
|
char debughelp[] = "toggle/set debugging mode"; |
char debughelp[] = "toggle/set debugging mode"; |
|
char deletehelp[] = "delete remote file"; |
char dirhelp[] = "list contents of remote directory"; |
char dirhelp[] = "list contents of remote directory"; |
char disconhelp[] = "terminate ftp session"; |
char disconhelp[] = "terminate ftp session"; |
char domachelp[] = "execute macro"; |
char domachelp[] = "execute macro"; |
|
#ifndef SMALLFTP |
|
char edithelp[] = "toggle command line editing"; |
|
#endif /* !SMALLFTP */ |
char formhelp[] = "set file transfer format"; |
char formhelp[] = "set file transfer format"; |
char globhelp[] = "toggle metacharacter expansion of local file names"; |
char globhelp[] = "toggle metacharacter expansion of local file names"; |
char hashhelp[] = "toggle printing `#' marks; specify number to set size"; |
char hashhelp[] = "toggle printing `#' marks; specify number to set size"; |
char helphelp[] = "print local help information"; |
char helphelp[] = "print local help information"; |
char idlehelp[] = "get (set) idle timer on remote side"; |
char idlehelp[] = "get (set) idle timer on remote side"; |
char lcdhelp[] = "change local working directory"; |
char lcdhelp[] = "change local working directory"; |
|
char lpwdhelp[] = "print local working directory"; |
char lshelp[] = "list contents of remote directory"; |
char lshelp[] = "list contents of remote directory"; |
char macdefhelp[] = "define a macro"; |
char macdefhelp[] = "define a macro"; |
char mdeletehelp[] = "delete multiple files"; |
char mdeletehelp[] = "delete multiple files"; |
|
|
char mgethelp[] = "get multiple files"; |
char mgethelp[] = "get multiple files"; |
char mkdirhelp[] = "make directory on the remote machine"; |
char mkdirhelp[] = "make directory on the remote machine"; |
char mlshelp[] = "list contents of multiple remote directories"; |
char mlshelp[] = "list contents of multiple remote directories"; |
char modtimehelp[] = "show last modification time of remote file"; |
|
char modehelp[] = "set file transfer mode"; |
char modehelp[] = "set file transfer mode"; |
|
char modtimehelp[] = "show last modification time of remote file"; |
char mputhelp[] = "send multiple files"; |
char mputhelp[] = "send multiple files"; |
char newerhelp[] = "get file if remote file is newer than local file "; |
char newerhelp[] = "get file if remote file is newer than local file "; |
char nlisthelp[] = "nlist contents of remote directory"; |
char nlisthelp[] = "nlist contents of remote directory"; |
char nmaphelp[] = "set templates for default file name mapping"; |
char nmaphelp[] = "set templates for default file name mapping"; |
char ntranshelp[] = "set translation table for default file name mapping"; |
char ntranshelp[] = "set translation table for default file name mapping"; |
|
char passivehelp[] = "enter passive transfer mode"; |
char porthelp[] = "toggle use of PORT cmd for each data connection"; |
char porthelp[] = "toggle use of PORT cmd for each data connection"; |
|
char preservehelp[] ="toggle preservation of modification time of " |
|
"retreived files"; |
|
char progresshelp[] ="toggle transfer progress meter"; |
char prompthelp[] = "force interactive prompting on multiple commands"; |
char prompthelp[] = "force interactive prompting on multiple commands"; |
char proxyhelp[] = "issue command on alternate connection"; |
char proxyhelp[] = "issue command on alternate connection"; |
char pwdhelp[] = "print working directory on remote machine"; |
char pwdhelp[] = "print working directory on remote machine"; |
|
|
char regethelp[] = "get file restarting at end of local file"; |
char regethelp[] = "get file restarting at end of local file"; |
char remotehelp[] = "get help from remote server"; |
char remotehelp[] = "get help from remote server"; |
char renamehelp[] = "rename file"; |
char renamehelp[] = "rename file"; |
|
char resethelp[] = "clear queued command replies"; |
char restarthelp[]= "restart file transfer at bytecount"; |
char restarthelp[]= "restart file transfer at bytecount"; |
char rmdirhelp[] = "remove directory on the remote machine"; |
char rmdirhelp[] = "remove directory on the remote machine"; |
char rmtstatushelp[]="show status of remote machine"; |
char rmtstatushelp[]="show status of remote machine"; |
char runiquehelp[] = "toggle store unique for local files"; |
char runiquehelp[] = "toggle store unique for local files"; |
char resethelp[] = "clear queued command replies"; |
|
char sendhelp[] = "send one file"; |
char sendhelp[] = "send one file"; |
char passivehelp[] = "enter passive transfer mode"; |
|
char sitehelp[] = "send site specific command to remote server\n\t\tTry \"rhelp site\" or \"site help\" for more information"; |
|
char shellhelp[] = "escape to the shell"; |
char shellhelp[] = "escape to the shell"; |
|
char sitehelp[] = "send site specific command to remote server\n" |
|
"\t\tTry \"rhelp site\" or \"site help\" " |
|
"for more information"; |
char sizecmdhelp[] = "show size of remote file"; |
char sizecmdhelp[] = "show size of remote file"; |
char statushelp[] = "show current status"; |
char statushelp[] = "show current status"; |
char structhelp[] = "set file transfer structure"; |
char structhelp[] = "set file transfer structure"; |
|
|
char userhelp[] = "send new user information"; |
char userhelp[] = "send new user information"; |
char verbosehelp[] = "toggle verbose mode"; |
char verbosehelp[] = "toggle verbose mode"; |
|
|
|
#ifdef SMALLFTP |
|
#define CMPL(x) |
|
#define CMPL0 |
|
#else /* !SMALLFTP */ |
|
#define CMPL(x) __STRING(x), |
|
#define CMPL0 "", |
|
#endif /* !SMALLFTP */ |
|
|
struct cmd cmdtab[] = { |
struct cmd cmdtab[] = { |
{ "!", shellhelp, 0, 0, 0, shell }, |
{ "!", shellhelp, 0, 0, 0, CMPL0 shell }, |
{ "$", domachelp, 1, 0, 0, domacro }, |
{ "$", domachelp, 1, 0, 0, CMPL0 domacro }, |
{ "account", accounthelp, 0, 1, 1, account}, |
{ "account", accounthelp, 0, 1, 1, CMPL0 account}, |
{ "append", appendhelp, 1, 1, 1, put }, |
{ "append", appendhelp, 1, 1, 1, CMPL(lr) put }, |
{ "ascii", asciihelp, 0, 1, 1, setascii }, |
{ "ascii", asciihelp, 0, 1, 1, CMPL0 setascii }, |
{ "bell", beephelp, 0, 0, 0, setbell }, |
{ "bell", beephelp, 0, 0, 0, CMPL0 setbell }, |
{ "binary", binaryhelp, 0, 1, 1, setbinary }, |
{ "binary", binaryhelp, 0, 1, 1, CMPL0 setbinary }, |
{ "bye", quithelp, 0, 0, 0, quit }, |
{ "bye", quithelp, 0, 0, 0, CMPL0 quit }, |
{ "case", casehelp, 0, 0, 1, setcase }, |
{ "case", casehelp, 0, 0, 1, CMPL0 setcase }, |
{ "cd", cdhelp, 0, 1, 1, cd }, |
{ "cd", cdhelp, 0, 1, 1, CMPL(r) cd }, |
{ "cdup", cduphelp, 0, 1, 1, cdup }, |
{ "cdup", cduphelp, 0, 1, 1, CMPL0 cdup }, |
{ "chmod", chmodhelp, 0, 1, 1, do_chmod }, |
{ "chmod", chmodhelp, 0, 1, 1, CMPL(nr) do_chmod }, |
{ "close", disconhelp, 0, 1, 1, disconnect }, |
{ "close", disconhelp, 0, 1, 1, CMPL0 disconnect }, |
{ "cr", crhelp, 0, 0, 0, setcr }, |
{ "cr", crhelp, 0, 0, 0, CMPL0 setcr }, |
{ "delete", deletehelp, 0, 1, 1, delete }, |
{ "debug", debughelp, 0, 0, 0, CMPL0 setdebug }, |
{ "debug", debughelp, 0, 0, 0, setdebug }, |
{ "delete", deletehelp, 0, 1, 1, CMPL(r) delete }, |
{ "dir", dirhelp, 1, 1, 1, ls }, |
{ "dir", dirhelp, 1, 1, 1, CMPL(rl) ls }, |
{ "disconnect", disconhelp, 0, 1, 1, disconnect }, |
{ "disconnect", disconhelp, 0, 1, 1, CMPL0 disconnect }, |
{ "form", formhelp, 0, 1, 1, setform }, |
#ifndef SMALLFTP |
{ "get", receivehelp, 1, 1, 1, get }, |
{ "edit", edithelp, 0, 0, 0, CMPL0 setedit }, |
{ "glob", globhelp, 0, 0, 0, setglob }, |
#endif /* !SMALLFTP */ |
{ "hash", hashhelp, 0, 0, 0, sethash }, |
{ "exit", quithelp, 0, 0, 0, CMPL0 quit }, |
{ "help", helphelp, 0, 0, 1, help }, |
{ "form", formhelp, 0, 1, 1, CMPL0 setform }, |
{ "idle", idlehelp, 0, 1, 1, idle }, |
{ "ftp", connecthelp, 0, 0, 1, CMPL0 setpeer }, |
{ "image", binaryhelp, 0, 1, 1, setbinary }, |
{ "get", receivehelp, 1, 1, 1, CMPL(rl) get }, |
{ "lcd", lcdhelp, 0, 0, 0, lcd }, |
{ "glob", globhelp, 0, 0, 0, CMPL0 setglob }, |
{ "ls", lshelp, 1, 1, 1, ls }, |
{ "hash", hashhelp, 0, 0, 0, CMPL0 sethash }, |
{ "macdef", macdefhelp, 0, 0, 0, macdef }, |
{ "help", helphelp, 0, 0, 1, CMPL(C) help }, |
{ "mdelete", mdeletehelp, 1, 1, 1, mdelete }, |
{ "idle", idlehelp, 0, 1, 1, CMPL0 idle }, |
{ "mdir", mdirhelp, 1, 1, 1, mls }, |
{ "image", binaryhelp, 0, 1, 1, CMPL0 setbinary }, |
{ "mget", mgethelp, 1, 1, 1, mget }, |
{ "lcd", lcdhelp, 0, 0, 0, CMPL(l) lcd }, |
{ "mkdir", mkdirhelp, 0, 1, 1, makedir }, |
{ "lpwd", lpwdhelp, 0, 0, 0, CMPL0 lpwd }, |
{ "mls", mlshelp, 1, 1, 1, mls }, |
{ "ls", lshelp, 1, 1, 1, CMPL(rl) ls }, |
{ "mode", modehelp, 0, 1, 1, setftmode }, |
{ "macdef", macdefhelp, 0, 0, 0, CMPL0 macdef }, |
{ "modtime", modtimehelp, 0, 1, 1, modtime }, |
{ "mdelete", mdeletehelp, 1, 1, 1, CMPL(R) mdelete }, |
{ "mput", mputhelp, 1, 1, 1, mput }, |
{ "mdir", mdirhelp, 1, 1, 1, CMPL(R) mls }, |
{ "newer", newerhelp, 1, 1, 1, newer }, |
{ "mget", mgethelp, 1, 1, 1, CMPL(R) mget }, |
{ "nmap", nmaphelp, 0, 0, 1, setnmap }, |
{ "mkdir", mkdirhelp, 0, 1, 1, CMPL(r) makedir }, |
{ "nlist", nlisthelp, 1, 1, 1, ls }, |
{ "mls", mlshelp, 1, 1, 1, CMPL(R) mls }, |
{ "ntrans", ntranshelp, 0, 0, 1, setntrans }, |
{ "mode", modehelp, 0, 1, 1, CMPL0 setftmode }, |
{ "open", connecthelp, 0, 0, 1, setpeer }, |
{ "modtime", modtimehelp, 0, 1, 1, CMPL(r) modtime }, |
{ "passive", passivehelp, 0, 0, 0, setpassive }, |
{ "mput", mputhelp, 1, 1, 1, CMPL(L) mput }, |
{ "prompt", prompthelp, 0, 0, 0, setprompt }, |
{ "msend", mputhelp, 1, 1, 1, CMPL(L) mput }, |
{ "proxy", proxyhelp, 0, 0, 1, doproxy }, |
{ "newer", newerhelp, 1, 1, 1, CMPL(r) newer }, |
{ "sendport", porthelp, 0, 0, 0, setport }, |
{ "nlist", nlisthelp, 1, 1, 1, CMPL(rl) ls }, |
{ "put", sendhelp, 1, 1, 1, put }, |
{ "nmap", nmaphelp, 0, 0, 1, CMPL0 setnmap }, |
{ "pwd", pwdhelp, 0, 1, 1, pwd }, |
{ "ntrans", ntranshelp, 0, 0, 1, CMPL0 setntrans }, |
{ "quit", quithelp, 0, 0, 0, quit }, |
{ "open", connecthelp, 0, 0, 1, CMPL0 setpeer }, |
{ "quote", quotehelp, 1, 1, 1, quote }, |
{ "passive", passivehelp, 0, 0, 0, CMPL0 setpassive }, |
{ "recv", receivehelp, 1, 1, 1, get }, |
{ "preserve", preservehelp, 0, 0, 0, CMPL0 setpreserve }, |
{ "reget", regethelp, 1, 1, 1, reget }, |
{ "progress", progresshelp, 0, 0, 0, CMPL0 setprogress }, |
{ "rstatus", rmtstatushelp, 0, 1, 1, rmtstatus }, |
{ "prompt", prompthelp, 0, 0, 0, CMPL0 setprompt }, |
{ "rhelp", remotehelp, 0, 1, 1, rmthelp }, |
{ "proxy", proxyhelp, 0, 0, 1, CMPL(c) doproxy }, |
{ "rename", renamehelp, 0, 1, 1, renamefile }, |
{ "put", sendhelp, 1, 1, 1, CMPL(lr) put }, |
{ "reset", resethelp, 0, 1, 1, reset }, |
{ "pwd", pwdhelp, 0, 1, 1, CMPL0 pwd }, |
{ "restart", restarthelp, 1, 1, 1, restart }, |
{ "quit", quithelp, 0, 0, 0, CMPL0 quit }, |
{ "rmdir", rmdirhelp, 0, 1, 1, removedir }, |
{ "quote", quotehelp, 1, 1, 1, CMPL0 quote }, |
{ "runique", runiquehelp, 0, 0, 1, setrunique }, |
{ "recv", receivehelp, 1, 1, 1, CMPL(rl) get }, |
{ "send", sendhelp, 1, 1, 1, put }, |
{ "reget", regethelp, 1, 1, 1, CMPL(rl) reget }, |
{ "site", sitehelp, 0, 1, 1, site }, |
{ "rename", renamehelp, 0, 1, 1, CMPL(rr) renamefile }, |
{ "size", sizecmdhelp, 1, 1, 1, sizecmd }, |
{ "reset", resethelp, 0, 1, 1, CMPL0 reset }, |
{ "status", statushelp, 0, 0, 1, status }, |
{ "restart", restarthelp, 1, 1, 1, CMPL0 restart }, |
{ "struct", structhelp, 0, 1, 1, setstruct }, |
{ "rhelp", remotehelp, 0, 1, 1, CMPL0 rmthelp }, |
{ "system", systemhelp, 0, 1, 1, syst }, |
{ "rmdir", rmdirhelp, 0, 1, 1, CMPL(r) removedir }, |
{ "sunique", suniquehelp, 0, 0, 1, setsunique }, |
{ "rstatus", rmtstatushelp, 0, 1, 1, CMPL(r) rmtstatus }, |
{ "tenex", tenexhelp, 0, 1, 1, settenex }, |
{ "runique", runiquehelp, 0, 0, 1, CMPL0 setrunique }, |
{ "trace", tracehelp, 0, 0, 0, settrace }, |
{ "send", sendhelp, 1, 1, 1, CMPL(lr) put }, |
{ "type", typehelp, 0, 1, 1, settype }, |
{ "sendport", porthelp, 0, 0, 0, CMPL0 setport }, |
{ "user", userhelp, 0, 1, 1, user }, |
{ "site", sitehelp, 0, 1, 1, CMPL0 site }, |
{ "umask", umaskhelp, 0, 1, 1, do_umask }, |
{ "size", sizecmdhelp, 1, 1, 1, CMPL(r) sizecmd }, |
{ "verbose", verbosehelp, 0, 0, 0, setverbose }, |
{ "status", statushelp, 0, 0, 1, CMPL0 status }, |
{ "?", helphelp, 0, 0, 1, help }, |
{ "struct", structhelp, 0, 1, 1, CMPL0 setstruct }, |
|
{ "sunique", suniquehelp, 0, 0, 1, CMPL0 setsunique }, |
|
{ "system", systemhelp, 0, 1, 1, CMPL0 syst }, |
|
{ "tenex", tenexhelp, 0, 1, 1, CMPL0 settenex }, |
|
{ "trace", tracehelp, 0, 0, 0, CMPL0 settrace }, |
|
{ "type", typehelp, 0, 1, 1, CMPL0 settype }, |
|
{ "umask", umaskhelp, 0, 1, 1, CMPL0 do_umask }, |
|
{ "user", userhelp, 0, 1, 1, CMPL0 user }, |
|
{ "verbose", verbosehelp, 0, 0, 0, CMPL0 setverbose }, |
|
{ "?", helphelp, 0, 0, 1, CMPL(C) help }, |
{ 0 }, |
{ 0 }, |
}; |
}; |
|
|