ReactOS 0.4.15-dev-7931-gfd331f1
cmdlist.c
Go to the documentation of this file.
1/* cmdlist.c
2 *
3 * Copyright (c) 1992-2001 by Mike Gleason.
4 * All rights reserved.
5 *
6 */
7
8#include "syshdrs.h"
9#include "shell.h"
10#include "bookmark.h"
11#include "cmds.h"
12
13/* These will be sorted lexiographically when the program is run, but
14 * they should already be listed that way.
15 */
17#if defined(WIN32) || defined(_WINDOWS)
18#else
19 { "!",
21 "[arguments]",
22 "Runs a subshell",
25 },
26#endif
27 { "?",
28 HelpCmd,
29 "[optional commands]",
30 "shows commands, or detailed help on specified commands",
33 },
34 { "ascii",
35 TypeCmd,
36 "",
37 "sets the file transfer type to ASCII text",
39 0, 0,
40 },
41 { "bgget",
43"[-flags] file1 [file2...]\n\
44Flags:\n\
45 -R : Recursive. Useful for fetching whole directories.\n\
46 -z : Get the remote file X, and name it to Y.\n\
47 -@ <time> : Wait until <time> to do the transfer.\n\
48 It must be expressed as one of the following:\n\
49 YYYYMMDDHHMMSS\n\
50 \"now + N hours|min|sec|days\"\n\
51 HH:MM",
52 "collects items to download later from the remote host",
54 1, kNoMax,
55 },
56 { "bgput",
58"[-flags] file1 [file2...]\n\
59Flags:\n\
60 -z : Send the local file X, and name the remote copy to Y.\n\
61 -R : Recursive. Useful for sending whole directories.\n\
62 -@ <time> : Wait until <time> to do the transfer.\n\
63 It must be expressed as one of the following:\n\
64 YYYYMMDDHHMMSS\n\
65 \"now + N hours|min|sec|days\"\n\
66 HH:MM",
67 "collects items to upload later to the remote host",
69 1, kNoMax,
70 },
71 { "bgstart",
73 "[n]",
74 "starts a ncftpbatch process to process spooled files",
75 0,
76 0, 1,
77 },
78 { "binary",
79 TypeCmd,
80 "",
81 "sets the file transfer type to binary/image",
83 0, 0,
84 },
85 { "bookmark",
87 "[bookmark-name-to-save-as]",
88 "Creates or updates a bookmark using the current host and directory",
90 0, 1,
91 },
92 { "bookmarks",
94 "[-l]",
95 "lets you edit the settings for each bookmark",
96 0,
98 },
99 { "bye",
101 "",
102 "exits NcFTP",
104 0, 0,
105 },
106 { "cat",
107 CatCmd,
108 "file1 [file2...]",
109 "views a file from the remote host",
111 1, kNoMax,
112 },
113 { "cd",
114 ChdirCmd,
115 "<directory>",
116 "changes remote working directory",
118 0, 1,
119 },
120 { "chmod",
121 ChmodCmd,
122 "mode file1 [file2...]",
123 "changes permissions for files on the remote host",
125 2, kNoMax,
126 },
127 { "close",
129 "",
130 "closes the connection to the remote host",
132 0, 0,
133 },
134 { "debug",
135 DebugCmd,
136 "[debug level]",
137 "sets debug mode to level x",
138 0,
139 kNoMin, kNoMax,
140 },
141 { "delete",
142 DeleteCmd,
143 "file1 [file2...]",
144 "deletes files from the remote host",
146 1, kNoMax,
147 },
148 { "dir",
149 ListCmd,
150 "[items to list]",
151 "prints a verbose directory listing",
153 kNoMin, kNoMax,
154 },
155 { "echo",
156 EchoCmd,
157 "[items to echo]",
158 "echos back to screen",
160 kNoMin, kNoMax,
161 },
162 { "exit",
164 "",
165 "quits NcFTP",
167 0, 0,
168 },
169 { "get",
170 GetCmd,
171"[-flags] file1 [file2...]\n\
172Flags:\n\
173 -R : Recursive. Useful for fetching whole directories.\n\
174 -z : Get the remote file X, and name it to Y.\n\
175 -a : Get files using ASCII mode.\n\
176 -A : Append entire remote file to the local file.\n\
177 -f : Force overwrite (do not try to auto-resume transfers).\n\
178Examples:\n\
179 get README\n\
180 get README.*\n\
181 get \"**Name with stars and spaces in it**\"\n\
182 get -R new-files-directory\n\
183 get -z WIN.INI ~/junk/windows-init-file",
184 "fetches files from the remote host",
186 1, kNoMax,
187 },
188 { "help",
189 HelpCmd,
190 "[optional commands]",
191 "shows commands, or detailed help on specified commands",
192 0,
193 kNoMin, kNoMax,
194 },
195 { "hosts",
197 "",
198 "lets you edit the settings for each remote host",
200 kNoMin, kNoMax,
201 },
202#if defined(WIN32) || defined(_WINDOWS)
203#else
204 { "jobs",
206 "",
207 "shows status of background NcFTP tasks",
208 0,
209 0, 0,
210 },
211#endif
212 { "lcd",
214 "<directory>",
215 "changes local working directory",
217 kNoMin, 1,
218 },
219#if defined(WIN32) || defined(_WINDOWS)
220#else
221 { "lchmod",
223 "mode file1 [file2...]",
224 "changes permissions for files on the local host",
226 2, kNoMax,
227 },
228#endif
229 { "less",
230 PageCmd,
231 "file1 [file2...]",
232 "views a file from the remote host one page at a time.",
234 1, kNoMax,
235 },
236 { "lls",
238 "[items to list]",
239 "prints a local directory listing",
241 kNoMin, kNoMax,
242 },
243 { "lmkdir",
245 "[directories]",
246 "creates directories on the local host",
247 0,
248 1, kNoMax,
249 },
250 { "lookup",
251 LookupCmd,
252 "<host or IP number> [<more hosts or IP numbers>]",
253 "looks up information in the host database",
254 0,
255 1, kNoMax,
256 },
257#if defined(WIN32) || defined(_WINDOWS)
258#else
259 { "lpage",
261 "file1 [file2...]",
262 "views a file on the local host one page at a time.",
264 1, kNoMax,
265 },
266#endif
267 { "lpwd",
269 "",
270 "Prints the current local working directory",
271 0,
272 0, 0,
273 },
274 { "lrename",
276 "oldname newname",
277 "changes the name of a file on the local host",
279 2, 2,
280 },
281 { "lrm",
283 "[files]",
284 "removes files on the local host",
286 1, kNoMax,
287 },
288 { "lrmdir",
290 "[directories]",
291 "removes directories on the local host",
293 1, kNoMax,
294 },
295 { "ls",
296 ListCmd,
297 "[items to list]",
298 "prints a remote directory listing",
300 kNoMin, kNoMax,
301 },
302 { "mget",
303 GetCmd,
304"[-flags] file1 [file2...]\n\
305Flags:\n\
306 -R : Recursive. Useful for fetching whole directories.\n\
307 -z : Get the remote file X, and name it to Y.\n\
308 -a : Get files using ASCII mode.\n\
309 -A : Append entire remote file to the local file.\n\
310 -f : Force overwrite (do not try to auto-resume transfers).\n\
311Examples:\n\
312 get README\n\
313 get README.*\n\
314 get \"**Name with stars and spaces in it**\"\n\
315 get -R new-files-directory\n\
316 get -z WIN.INI ~/junk/windows-init-file",
317 "fetches files from the remote host",
319 1, kNoMax,
320 },
321 { "mkdir",
322 MkdirCmd,
323 "dir1 [dir2...]",
324 "creates directories on the remote host",
326 1, kNoMax,
327 },
328 { "mls",
329 MlsCmd,
330 "[<directory to list> | -d <single item to list>]",
331 "prints a machine-readable directory listing",
333 kNoMin, kNoMax,
334 },
335 { "more",
336 PageCmd,
337 "file1 [file2...]",
338 "views a file from the remote host one page at a time.",
340 1, kNoMax,
341 },
342 { "mput",
343 PutCmd,
344"[-flags] file1 [file2...]\n\
345Flags:\n\
346 -z : Send the local file X, and name the remote copy to Y.\n\
347 -f : Force overwrite (do not try to auto-resume transfers).\n\
348 -a : Send files using ASCII mode.\n\
349 -A : Append entire local file to the remote file.\n\
350 -R : Recursive. Useful for sending whole directories.\n\
351Examples:\n\
352 put README\n\
353 put -z ~/junk/windows-init-file WIN.INI",
354 "sends files to the remote host",
356 1, kNoMax,
357 },
358 { "page",
359 PageCmd,
360 "file1 [file2...]",
361 "views a file from the remote host one page at a time.",
363 1, kNoMax,
364 },
365 { "open",
366 OpenCmd,
367"[-flags] [sitename]\n\
368Flags:\n\
369 -a : Open anonymously.\n\
370 -u XX : Login with username XX.\n\
371 -p XX : Login with password XX.\n\
372 -j XX : Login with account XX.\n\
373 -P XX : Use port number X when opening.\n\
374Examples:\n\
375 open sphygmomanometer.unl.edu\n\
376 open -u mario bowser.nintendo.co.jp\n",
377 "connects to a remote host",
379 kNoMin, kNoMax,
380 },
381 { "pdir",
382 ListCmd,
383 "[items to list]",
384 "views a directory listing through your pager",
386 kNoMin, kNoMax,
387 },
388 { "pls",
389 ListCmd,
390 "[items to list]",
391 "views a directory listing through your pager",
393 kNoMin, kNoMax,
394 },
395 { "prefs",
396 (CmdProc) SetCmd,
397 "",
398 "shows the program's settings",
400 0, 0,
401 },
402 { "put",
403 PutCmd,
404"[-flags] file1 [file2...]\n\
405Flags:\n\
406 -z : Send the local file X, and name the remote copy to Y.\n\
407 -f : Force overwrite (do not try to auto-resume transfers).\n\
408 -a : Send files using ASCII mode.\n\
409 -A : Append entire local file to the remote file.\n\
410 -R : Recursive. Useful for sending whole directories.\n\
411Examples:\n\
412 put README\n\
413 put -z ~/junk/windows-init-file WIN.INI",
414 "sends a file to the remote host",
416 1, kNoMax,
417 },
418 { "pwd",
419 (CmdProc) PwdCmd,
420 "",
421 "Prints the current remote working directory",
423 0, 0,
424 },
425 { "quit",
427 "",
428 "take a wild guess",
429 0,
430 0, 0,
431 },
432 { "quote",
433 QuoteCmd,
434 "command-string",
435 "sends an FTP command to the remote server",
437 1, kNoMax,
438 },
439 { "rename",
440 RenameCmd,
441 "oldname newname",
442 "changes the name of a file on the remote host",
444 2, 2,
445 },
446 { "rglob",
447 RGlobCmd,
448 "regex",
449 "tests remote filename wildcard matching",
451 1, kNoMax,
452 },
453 { "rhelp",
455 "[help string]",
456 "requests help from the remote server",
458 kNoMin, kNoMax,
459 },
460 { "rm",
461 DeleteCmd,
462 "[-r] file1 [file2...]",
463 "deletes files from the remote host",
465 1, kNoMax,
466 },
467 { "rmdir",
468 RmdirCmd,
469 "dir1 [dir2...]",
470 "deletes directories from the remote host",
472 1, kNoMax,
473 },
474 { "set",
475 SetCmd,
476 "[option [newvalue]]",
477 "lets you configure a program setting from the command line",
479 0, 2,
480 },
481 { "show",
482 (CmdProc) SetCmd,
483 "[option]",
484 "shows one or more the program's settings",
486 0, 1,
487 },
488 { "site",
489 SiteCmd,
490 "command-string",
491 "sends a host-specific FTP command to the remote server",
493 1, kNoMax,
494 },
495 { "symlink",
497 "existing-item link-item",
498 "creates a symbolic link on the remote host",
500 2, 2,
501 },
502 { "type",
503 TypeCmd,
504 "[ascii | binary | image]",
505 "sets file transfer type (one of 'ascii' or 'binary')",
507 0, 1,
508 },
509 { "umask",
510 UmaskCmd,
511 "mask",
512 "sets the process umask on remote host",
514 1, 1,
515 },
516 { "version",
518 "",
519 "prints version information",
520 0,
521 kNoMin, kNoMax,
522 },
523};
524
525size_t gNumCommands = ((size_t) (sizeof(gCommands) / sizeof(Command)));
526
527/* eof */
size_t gNumCommands
Definition: cmdlist.c:525
Command gCommands[]
Definition: cmdlist.c:16
__kernel_size_t size_t
Definition: linux.h:237
void HostsCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1329
void LocalPwdCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1871
void EchoCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:706
void GetCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:916
void ChdirCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:558
void BookmarkCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:323
void ChmodCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:612
void SiteCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3146
void SpoolGetCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3298
void SpoolPutCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3454
void RenameCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2988
void PageCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2496
void LocalListCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1552
void LookupCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1886
void RGlobCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2954
void UmaskCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3672
void PwdCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2876
void SymlinkCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3609
void SetCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3078
void JobsCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1358
void LocalMkdirCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1751
void MlsCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1937
void ShellCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3094
void QuitCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2923
void LocalRmCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1802
void DebugCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:650
void LocalRenameCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1786
void BGStartCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3266
void LocalPageCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1775
void LocalChdirCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1514
void QuoteCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2934
void CatCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:356
void RmdirCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3007
void HelpCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1036
void CloseCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:637
void LocalChmodCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1741
void LocalRmdirCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1836
void TypeCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3627
void VersionCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3687
void RmtHelpCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:3041
void OpenCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2317
void DeleteCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:664
void ListCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:1371
void PutCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2768
void MkdirCmd(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: cmds.c:2011
#define kCompleteRemoteDir
Definition: shell.h:62
void(* CmdProc)(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: shell.h:29
#define kCmdHidden
Definition: shell.h:58
#define kCompleteRemoteFile
Definition: shell.h:61
#define kCmdMustBeConnected
Definition: shell.h:59
#define kCompleteLocalDir
Definition: shell.h:64
#define kCmdMustBeDisconnected
Definition: shell.h:60
#define kCompleteLocalFile
Definition: shell.h:63
#define kCompleteBookmark
Definition: shell.h:65
#define kCompletePrefOpt
Definition: shell.h:66
#define kNoMax
Definition: shell.h:34
#define kNoMin
Definition: shell.h:35
Definition: shell.h:41