#2013_10_03 星期四 add by greshem
J:\portage\net-ftp\tnftp\tnftp-20100108.chm::/S/55.html#L143
main
for (;;)
cmdscanner();
733 getcmd(margv[0]);
#在 cmdtab 中 查找函数 cmd 命令
761 (*c->c_handler)(margc, margv);
#==========================================================================
#注册的 命令行的列表
197 struct cmd cmdtab[] = {
198 { "!", H(shellhelp), 0, 0, 0, CMPL0 shell },
199 { "$", H(domachelp), 1, 0, 0, CMPL0 domacro },
200 { "account", H(accounthelp), 0, 1, 1, CMPL0 account},
201 { "append", H(appendhelp), 1, 1, 1, CMPL(lr) put },
202 { "ascii", H(asciihelp), 0, 1, 1, CMPL0 setascii },
203 { "bell", H(beephelp), 0, 0, 0, CMPL0 setbell },
204 { "binary", H(binaryhelp), 0, 1, 1, CMPL0 setbinary },
205 { "bye", H(quithelp), 0, 0, 0, CMPL0 quit },
206 { "case", H(casehelp), 0, 0, 1, CMPL0 setcase },
207 { "cd", H(cdhelp), 0, 1, 1, CMPL(r) cd },
208 { "cdup", H(cduphelp), 0, 1, 1, CMPL0 cdup },
209 { "chmod", H(chmodhelp), 0, 1, 1, CMPL(nr) do_chmod },
210 { "close", H(disconhelp), 0, 1, 1, CMPL0 disconnect },
211 { "cr", H(crhelp), 0, 0, 0, CMPL0 setcr },
212 { "debug", H(debughelp), 0, 0, 0, CMPL0 setdebug },
213 { "delete", H(deletehelp), 0, 1, 1, CMPL(r) delete },
214 { "dir", H(lshelp), 1, 1, 1, CMPL(rl) ls },
215 { "disconnect", H(disconhelp), 0, 1, 1, CMPL0 disconnect },
216 { "edit", H(edithelp), 0, 0, 0, CMPL0 setedit },
217 { "epsv", H(epsvhelp), 0, 0, 0, CMPL0 setepsv },
218 { "epsv4", H(epsv4help), 0, 0, 0, CMPL0 setepsv4 },
219 { "epsv6", H(epsv6help), 0, 0, 0, CMPL0 setepsv6 },
220 { "exit", H(quithelp), 0, 0, 0, CMPL0 quit },
221 { "features", H(feathelp), 0, 1, 1, CMPL0 feat },
222 { "fget", H(fgethelp), 1, 1, 1, CMPL(l) fget },
223 { "form", H(formhelp), 0, 1, 1, CMPL0 setform },
224 { "ftp", H(connecthelp), 0, 0, 1, CMPL0 setpeer },
225 { "gate", H(gatehelp), 0, 0, 0, CMPL0 setgate },
226 { "get", H(receivehelp), 1, 1, 1, CMPL(rl) get },
227 { "glob", H(globhelp), 0, 0, 0, CMPL0 setglob },
228 { "hash", H(hashhelp), 0, 0, 0, CMPL0 sethash },
229 { "help", H(helphelp), 0, 0, 1, CMPL(C) help },
230 { "idle", H(idlehelp), 0, 1, 1, CMPL0 idlecmd },
231 { "image", H(binaryhelp), 0, 1, 1, CMPL0 setbinary },
232 { "lcd", H(lcdhelp), 0, 0, 0, CMPL(l) lcd },
233 { "less", H(pagehelp), 1, 1, 1, CMPL(r) page },
234 { "lpage", H(lpagehelp), 0, 0, 0, CMPL(l) lpage },
235 { "lpwd", H(lpwdhelp), 0, 0, 0, CMPL0 lpwd },
236 { "ls", H(lshelp), 1, 1, 1, CMPL(rl) ls },
237 { "macdef", H(macdefhelp), 0, 0, 0, CMPL0 macdef },
238 { "mdelete", H(mdeletehelp), 1, 1, 1, CMPL(R) mdelete },
239 { "mdir", H(mlshelp), 1, 1, 1, CMPL(R) mls },
240 { "mget", H(mgethelp), 1, 1, 1, CMPL(R) mget },
241 { "mkdir", H(mkdirhelp), 0, 1, 1, CMPL(r) makedir },
242 { "mls", H(mlshelp), 1, 1, 1, CMPL(R) mls },
243 { "mlsd", H(mlsdhelp), 1, 1, 1, CMPL(r) ls },
244 { "mlst", H(mlsthelp), 1, 1, 1, CMPL(r) mlst },
245 { "mode", H(modehelp), 0, 1, 1, CMPL0 setftmode },
246 { "modtime", H(modtimehelp), 0, 1, 1, CMPL(r) modtime },
247 { "more", H(pagehelp), 1, 1, 1, CMPL(r) page },
248 { "mput", H(mputhelp), 1, 1, 1, CMPL(L) mput },
249 { "mreget", H(mregethelp), 1, 1, 1, CMPL(R) mget },
250 { "msend", H(mputhelp), 1, 1, 1, CMPL(L) mput },
251 { "newer", H(newerhelp), 1, 1, 1, CMPL(r) newer },
252 { "nlist", H(lshelp), 1, 1, 1, CMPL(rl) ls },
253 { "nmap", H(nmaphelp), 0, 0, 1, CMPL0 setnmap },
254 { "ntrans", H(ntranshelp), 0, 0, 1, CMPL0 setntrans },
255 { "open", H(connecthelp), 0, 0, 1, CMPL0 setpeer },
256 { "page", H(pagehelp), 1, 1, 1, CMPL(r) page },
257 { "passive", H(passivehelp), 0, 0, 0, CMPL0 setpassive },
258 { "pdir", H(plshelp), 1, 1, 1, CMPL(r) ls },
259 { "pls", H(plshelp), 1, 1, 1, CMPL(r) ls },
260 { "pmlsd", H(pmlsdhelp), 1, 1, 1, CMPL(r) ls },
261 { "preserve", H(preservehelp),0, 0, 0, CMPL0 setpreserve },
262 { "progress", H(progresshelp),0, 0, 0, CMPL0 setprogress },
263 { "prompt", H(prompthelp), 0, 0, 0, CMPL0 setprompt },
264 { "proxy", H(proxyhelp), 0, 0, 1, CMPL(c) doproxy },
265 { "put", H(sendhelp), 1, 1, 1, CMPL(lr) put },
266 { "pwd", H(pwdhelp), 0, 1, 1, CMPL0 pwd },
267 { "quit", H(quithelp), 0, 0, 0, CMPL0 quit },
268 { "quote", H(quotehelp), 1, 1, 1, CMPL0 quote },
269 { "rate", H(ratehelp), 0, 0, 0, CMPL0 setrate },
270 { "rcvbuf", H(xferbufhelp), 0, 0, 0, CMPL0 setxferbuf },
271 { "recv", H(receivehelp), 1, 1, 1, CMPL(rl) get },
272 { "reget", H(regethelp), 1, 1, 1, CMPL(rl) reget },
273 { "remopts", H(optshelp), 0, 1, 1, CMPL0 opts },
274 { "rename", H(renamehelp), 0, 1, 1, CMPL(rr) renamefile },
275 { "reset", H(resethelp), 0, 1, 1, CMPL0 reset },
276 { "restart", H(restarthelp), 1, 1, 1, CMPL0 restart },
277 { "rhelp", H(remotehelp), 0, 1, 1, CMPL0 rmthelp },
278 { "rmdir", H(rmdirhelp), 0, 1, 1, CMPL(r) removedir },
279 { "rstatus", H(rmtstatushelp),0, 1, 1, CMPL(r) rmtstatus },
280 { "runique", H(runiquehelp), 0, 0, 1, CMPL0 setrunique },
281 { "send", H(sendhelp), 1, 1, 1, CMPL(lr) put },
282 { "sendport", H(porthelp), 0, 0, 0, CMPL0 setport },
283 { "set", H(sethelp), 0, 0, 0, CMPL(o) setoption },
284 { "site", H(sitehelp), 0, 1, 1, CMPL0 site },
285 { "size", H(sizecmdhelp), 1, 1, 1, CMPL(r) sizecmd },
286 { "sndbuf", H(xferbufhelp), 0, 0, 0, CMPL0 setxferbuf },
287 { "status", H(statushelp), 0, 0, 1, CMPL0 status },
288 { "struct", H(structhelp), 0, 1, 1, CMPL0 setstruct },
289 { "sunique", H(suniquehelp), 0, 0, 1, CMPL0 setsunique },
290 { "system", H(systemhelp), 0, 1, 1, CMPL0 syst },
291 { "tenex", H(tenexhelp), 0, 1, 1, CMPL0 settenex },
292 { "throttle", H(ratehelp), 0, 0, 0, CMPL0 setrate },
293 { "trace", H(tracehelp), 0, 0, 0, CMPL0 settrace },
294 { "type", H(typehelp), 0, 1, 1, CMPL0 settype },
295 { "umask", H(umaskhelp), 0, 1, 1, CMPL0 do_umask },
296 { "unset", H(unsethelp), 0, 0, 0, CMPL(o) unsetoption },
297 { "usage", H(usagehelp), 0, 0, 1, CMPL(C) help },
298 { "user", H(userhelp), 0, 1, 1, CMPL0 user },
299 { "verbose", H(verbosehelp), 0, 0, 0, CMPL0 setverbose },
300 { "xferbuf", H(xferbufhelp), 0, 0, 0, CMPL0 setxferbuf },
301 { "?", H(helphelp), 0, 0, 1, CMPL(C) help },
302 { NULL, NULL, 0, 0, 0, CMPL0 NULL },
J:\portage\net-ftp\tnftp\tnftp-20100108.chm::/S/55.html#L143
main
for (;;)
cmdscanner();
733 getcmd(margv[0]);
#在 cmdtab 中 查找函数 cmd 命令
761 (*c->c_handler)(margc, margv);
#==========================================================================
#注册的 命令行的列表
197 struct cmd cmdtab[] = {
198 { "!", H(shellhelp), 0, 0, 0, CMPL0 shell },
199 { "$", H(domachelp), 1, 0, 0, CMPL0 domacro },
200 { "account", H(accounthelp), 0, 1, 1, CMPL0 account},
201 { "append", H(appendhelp), 1, 1, 1, CMPL(lr) put },
202 { "ascii", H(asciihelp), 0, 1, 1, CMPL0 setascii },
203 { "bell", H(beephelp), 0, 0, 0, CMPL0 setbell },
204 { "binary", H(binaryhelp), 0, 1, 1, CMPL0 setbinary },
205 { "bye", H(quithelp), 0, 0, 0, CMPL0 quit },
206 { "case", H(casehelp), 0, 0, 1, CMPL0 setcase },
207 { "cd", H(cdhelp), 0, 1, 1, CMPL(r) cd },
208 { "cdup", H(cduphelp), 0, 1, 1, CMPL0 cdup },
209 { "chmod", H(chmodhelp), 0, 1, 1, CMPL(nr) do_chmod },
210 { "close", H(disconhelp), 0, 1, 1, CMPL0 disconnect },
211 { "cr", H(crhelp), 0, 0, 0, CMPL0 setcr },
212 { "debug", H(debughelp), 0, 0, 0, CMPL0 setdebug },
213 { "delete", H(deletehelp), 0, 1, 1, CMPL(r) delete },
214 { "dir", H(lshelp), 1, 1, 1, CMPL(rl) ls },
215 { "disconnect", H(disconhelp), 0, 1, 1, CMPL0 disconnect },
216 { "edit", H(edithelp), 0, 0, 0, CMPL0 setedit },
217 { "epsv", H(epsvhelp), 0, 0, 0, CMPL0 setepsv },
218 { "epsv4", H(epsv4help), 0, 0, 0, CMPL0 setepsv4 },
219 { "epsv6", H(epsv6help), 0, 0, 0, CMPL0 setepsv6 },
220 { "exit", H(quithelp), 0, 0, 0, CMPL0 quit },
221 { "features", H(feathelp), 0, 1, 1, CMPL0 feat },
222 { "fget", H(fgethelp), 1, 1, 1, CMPL(l) fget },
223 { "form", H(formhelp), 0, 1, 1, CMPL0 setform },
224 { "ftp", H(connecthelp), 0, 0, 1, CMPL0 setpeer },
225 { "gate", H(gatehelp), 0, 0, 0, CMPL0 setgate },
226 { "get", H(receivehelp), 1, 1, 1, CMPL(rl) get },
227 { "glob", H(globhelp), 0, 0, 0, CMPL0 setglob },
228 { "hash", H(hashhelp), 0, 0, 0, CMPL0 sethash },
229 { "help", H(helphelp), 0, 0, 1, CMPL(C) help },
230 { "idle", H(idlehelp), 0, 1, 1, CMPL0 idlecmd },
231 { "image", H(binaryhelp), 0, 1, 1, CMPL0 setbinary },
232 { "lcd", H(lcdhelp), 0, 0, 0, CMPL(l) lcd },
233 { "less", H(pagehelp), 1, 1, 1, CMPL(r) page },
234 { "lpage", H(lpagehelp), 0, 0, 0, CMPL(l) lpage },
235 { "lpwd", H(lpwdhelp), 0, 0, 0, CMPL0 lpwd },
236 { "ls", H(lshelp), 1, 1, 1, CMPL(rl) ls },
237 { "macdef", H(macdefhelp), 0, 0, 0, CMPL0 macdef },
238 { "mdelete", H(mdeletehelp), 1, 1, 1, CMPL(R) mdelete },
239 { "mdir", H(mlshelp), 1, 1, 1, CMPL(R) mls },
240 { "mget", H(mgethelp), 1, 1, 1, CMPL(R) mget },
241 { "mkdir", H(mkdirhelp), 0, 1, 1, CMPL(r) makedir },
242 { "mls", H(mlshelp), 1, 1, 1, CMPL(R) mls },
243 { "mlsd", H(mlsdhelp), 1, 1, 1, CMPL(r) ls },
244 { "mlst", H(mlsthelp), 1, 1, 1, CMPL(r) mlst },
245 { "mode", H(modehelp), 0, 1, 1, CMPL0 setftmode },
246 { "modtime", H(modtimehelp), 0, 1, 1, CMPL(r) modtime },
247 { "more", H(pagehelp), 1, 1, 1, CMPL(r) page },
248 { "mput", H(mputhelp), 1, 1, 1, CMPL(L) mput },
249 { "mreget", H(mregethelp), 1, 1, 1, CMPL(R) mget },
250 { "msend", H(mputhelp), 1, 1, 1, CMPL(L) mput },
251 { "newer", H(newerhelp), 1, 1, 1, CMPL(r) newer },
252 { "nlist", H(lshelp), 1, 1, 1, CMPL(rl) ls },
253 { "nmap", H(nmaphelp), 0, 0, 1, CMPL0 setnmap },
254 { "ntrans", H(ntranshelp), 0, 0, 1, CMPL0 setntrans },
255 { "open", H(connecthelp), 0, 0, 1, CMPL0 setpeer },
256 { "page", H(pagehelp), 1, 1, 1, CMPL(r) page },
257 { "passive", H(passivehelp), 0, 0, 0, CMPL0 setpassive },
258 { "pdir", H(plshelp), 1, 1, 1, CMPL(r) ls },
259 { "pls", H(plshelp), 1, 1, 1, CMPL(r) ls },
260 { "pmlsd", H(pmlsdhelp), 1, 1, 1, CMPL(r) ls },
261 { "preserve", H(preservehelp),0, 0, 0, CMPL0 setpreserve },
262 { "progress", H(progresshelp),0, 0, 0, CMPL0 setprogress },
263 { "prompt", H(prompthelp), 0, 0, 0, CMPL0 setprompt },
264 { "proxy", H(proxyhelp), 0, 0, 1, CMPL(c) doproxy },
265 { "put", H(sendhelp), 1, 1, 1, CMPL(lr) put },
266 { "pwd", H(pwdhelp), 0, 1, 1, CMPL0 pwd },
267 { "quit", H(quithelp), 0, 0, 0, CMPL0 quit },
268 { "quote", H(quotehelp), 1, 1, 1, CMPL0 quote },
269 { "rate", H(ratehelp), 0, 0, 0, CMPL0 setrate },
270 { "rcvbuf", H(xferbufhelp), 0, 0, 0, CMPL0 setxferbuf },
271 { "recv", H(receivehelp), 1, 1, 1, CMPL(rl) get },
272 { "reget", H(regethelp), 1, 1, 1, CMPL(rl) reget },
273 { "remopts", H(optshelp), 0, 1, 1, CMPL0 opts },
274 { "rename", H(renamehelp), 0, 1, 1, CMPL(rr) renamefile },
275 { "reset", H(resethelp), 0, 1, 1, CMPL0 reset },
276 { "restart", H(restarthelp), 1, 1, 1, CMPL0 restart },
277 { "rhelp", H(remotehelp), 0, 1, 1, CMPL0 rmthelp },
278 { "rmdir", H(rmdirhelp), 0, 1, 1, CMPL(r) removedir },
279 { "rstatus", H(rmtstatushelp),0, 1, 1, CMPL(r) rmtstatus },
280 { "runique", H(runiquehelp), 0, 0, 1, CMPL0 setrunique },
281 { "send", H(sendhelp), 1, 1, 1, CMPL(lr) put },
282 { "sendport", H(porthelp), 0, 0, 0, CMPL0 setport },
283 { "set", H(sethelp), 0, 0, 0, CMPL(o) setoption },
284 { "site", H(sitehelp), 0, 1, 1, CMPL0 site },
285 { "size", H(sizecmdhelp), 1, 1, 1, CMPL(r) sizecmd },
286 { "sndbuf", H(xferbufhelp), 0, 0, 0, CMPL0 setxferbuf },
287 { "status", H(statushelp), 0, 0, 1, CMPL0 status },
288 { "struct", H(structhelp), 0, 1, 1, CMPL0 setstruct },
289 { "sunique", H(suniquehelp), 0, 0, 1, CMPL0 setsunique },
290 { "system", H(systemhelp), 0, 1, 1, CMPL0 syst },
291 { "tenex", H(tenexhelp), 0, 1, 1, CMPL0 settenex },
292 { "throttle", H(ratehelp), 0, 0, 0, CMPL0 setrate },
293 { "trace", H(tracehelp), 0, 0, 0, CMPL0 settrace },
294 { "type", H(typehelp), 0, 1, 1, CMPL0 settype },
295 { "umask", H(umaskhelp), 0, 1, 1, CMPL0 do_umask },
296 { "unset", H(unsethelp), 0, 0, 0, CMPL(o) unsetoption },
297 { "usage", H(usagehelp), 0, 0, 1, CMPL(C) help },
298 { "user", H(userhelp), 0, 1, 1, CMPL0 user },
299 { "verbose", H(verbosehelp), 0, 0, 0, CMPL0 setverbose },
300 { "xferbuf", H(xferbufhelp), 0, 0, 0, CMPL0 setxferbuf },
301 { "?", H(helphelp), 0, 0, 1, CMPL(C) help },
302 { NULL, NULL, 0, 0, 0, CMPL0 NULL },