From 9a22ac94a4d1be0377562644e3704a2134b9d645 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Sun, 30 Sep 2001 06:49:44 +0000 Subject: I told Jeremy at the CIFS conference that I would sort the command list in smbclient. Done. I had a little trouble because the "!" command is a special case and must be listed last. Awkward. Chris -)----- (This used to be commit 14bfd9107a9c875c54e281262f8061c20a5e9398) --- source3/client/client.c | 63 ++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/source3/client/client.c b/source3/client/client.c index 2b76de81eb..448f4314c8 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -1695,7 +1695,11 @@ static BOOL list_servers(char *wk_grp) #define COMPL_REMOTE 1 /* Complete remote filename */ #define COMPL_LOCAL 2 /* Complete local filename */ -/* This defines the commands supported by this client */ +/* This defines the commands supported by this client. + * NOTE: The "!" must be the last one in the list because it's fn pointer + * field is NULL, and NULL in that field is used in process_tok() + * (below) to indicate the end of the list. crh + */ struct { char *name; @@ -1704,47 +1708,46 @@ struct char compl_args[2]; /* Completion argument info */ } commands[] = { - {"ls",cmd_dir," list the contents of the current directory",{COMPL_REMOTE,COMPL_NONE}}, + {"archive",cmd_archive,"\n0=ignore archive bit\n1=only get archive files\n2=only get archive files and reset archive bit\n3=get all files and reset archive bit",{COMPL_NONE,COMPL_NONE}}, + {"blocksize",cmd_block,"blocksize (default 20)",{COMPL_NONE,COMPL_NONE}}, + {"cancel",cmd_cancel," cancel a print queue entry",{COMPL_NONE,COMPL_NONE}}, + {"cd",cmd_cd,"[directory] change/report the remote directory",{COMPL_REMOTE,COMPL_NONE}}, + {"del",cmd_del," delete all matching files",{COMPL_REMOTE,COMPL_NONE}}, {"dir",cmd_dir," list the contents of the current directory",{COMPL_REMOTE,COMPL_NONE}}, {"du",cmd_du," computes the total size of the current directory",{COMPL_REMOTE,COMPL_NONE}}, - {"lcd",cmd_lcd,"[directory] change/report the local current working directory",{COMPL_LOCAL,COMPL_NONE}}, - {"cd",cmd_cd,"[directory] change/report the remote directory",{COMPL_REMOTE,COMPL_NONE}}, - {"pwd",cmd_pwd,"show current remote directory (same as 'cd' with no args)",{COMPL_NONE,COMPL_NONE}}, + {"exit",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}}, {"get",cmd_get," [local name] get a file",{COMPL_REMOTE,COMPL_LOCAL}}, + {"help",cmd_help,"[command] give help on a command",{COMPL_NONE,COMPL_NONE}}, + {"history",cmd_history,"displays the command history",{COMPL_NONE,COMPL_NONE}}, + {"lcd",cmd_lcd,"[directory] change/report the local current working directory",{COMPL_LOCAL,COMPL_NONE}}, + {"lowercase",cmd_lowercase,"toggle lowercasing of filenames for get",{COMPL_NONE,COMPL_NONE}}, + {"ls",cmd_dir," list the contents of the current directory",{COMPL_REMOTE,COMPL_NONE}}, + {"mask",cmd_select," mask all filenames against this",{COMPL_REMOTE,COMPL_NONE}}, + {"md",cmd_mkdir," make a directory",{COMPL_NONE,COMPL_NONE}}, {"mget",cmd_mget," get all the matching files",{COMPL_REMOTE,COMPL_NONE}}, - {"put",cmd_put," [remote name] put a file",{COMPL_LOCAL,COMPL_REMOTE}}, - {"mput",cmd_mput," put all matching files",{COMPL_REMOTE,COMPL_NONE}}, - {"rename",cmd_rename," rename some files",{COMPL_REMOTE,COMPL_REMOTE}}, + {"mkdir",cmd_mkdir," make a directory",{COMPL_NONE,COMPL_NONE}}, {"more",cmd_more," view a remote file with your pager",{COMPL_REMOTE,COMPL_NONE}}, - {"mask",cmd_select," mask all filenames against this",{COMPL_REMOTE,COMPL_NONE}}, - {"del",cmd_del," delete all matching files",{COMPL_REMOTE,COMPL_NONE}}, + {"mput",cmd_mput," put all matching files",{COMPL_REMOTE,COMPL_NONE}}, + {"newer",cmd_newer," only mget files newer than the specified local file",{COMPL_LOCAL,COMPL_NONE}}, {"open",cmd_open," open a file",{COMPL_REMOTE,COMPL_NONE}}, - {"rm",cmd_del," delete all matching files",{COMPL_REMOTE,COMPL_NONE}}, - {"mkdir",cmd_mkdir," make a directory",{COMPL_NONE,COMPL_NONE}}, - {"md",cmd_mkdir," make a directory",{COMPL_NONE,COMPL_NONE}}, - {"rmdir",cmd_rmdir," remove a directory",{COMPL_NONE,COMPL_NONE}}, - {"rd",cmd_rmdir," remove a directory",{COMPL_NONE,COMPL_NONE}}, - {"prompt",cmd_prompt,"toggle prompting for filenames for mget and mput",{COMPL_NONE,COMPL_NONE}}, - {"recurse",cmd_recurse,"toggle directory recursion for mget and mput",{COMPL_NONE,COMPL_NONE}}, - {"translate",cmd_translate,"toggle text translation for printing",{COMPL_NONE,COMPL_NONE}}, - {"lowercase",cmd_lowercase,"toggle lowercasing of filenames for get",{COMPL_NONE,COMPL_NONE}}, {"print",cmd_print," print a file",{COMPL_NONE,COMPL_NONE}}, {"printmode",cmd_printmode," set the print mode",{COMPL_NONE,COMPL_NONE}}, + {"prompt",cmd_prompt,"toggle prompting for filenames for mget and mput",{COMPL_NONE,COMPL_NONE}}, + {"put",cmd_put," [remote name] put a file",{COMPL_LOCAL,COMPL_REMOTE}}, + {"pwd",cmd_pwd,"show current remote directory (same as 'cd' with no args)",{COMPL_NONE,COMPL_NONE}}, + {"q",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}}, {"queue",cmd_queue,"show the print queue",{COMPL_NONE,COMPL_NONE}}, - {"cancel",cmd_cancel," cancel a print queue entry",{COMPL_NONE,COMPL_NONE}}, {"quit",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}}, - {"q",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}}, - {"exit",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}}, - {"newer",cmd_newer," only mget files newer than the specified local file",{COMPL_LOCAL,COMPL_NONE}}, - {"archive",cmd_archive,"\n0=ignore archive bit\n1=only get archive files\n2=only get archive files and reset archive bit\n3=get all files and reset archive bit",{COMPL_NONE,COMPL_NONE}}, - {"tar",cmd_tar,"tar [IXFqbgNan] current directory to/from ",{COMPL_NONE,COMPL_NONE}}, - {"blocksize",cmd_block,"blocksize (default 20)",{COMPL_NONE,COMPL_NONE}}, - {"tarmode",cmd_tarmode, - " tar's behaviour towards archive bits",{COMPL_NONE,COMPL_NONE}}, + {"rd",cmd_rmdir," remove a directory",{COMPL_NONE,COMPL_NONE}}, + {"recurse",cmd_recurse,"toggle directory recursion for mget and mput",{COMPL_NONE,COMPL_NONE}}, + {"rename",cmd_rename," rename some files",{COMPL_REMOTE,COMPL_REMOTE}}, + {"rm",cmd_del," delete all matching files",{COMPL_REMOTE,COMPL_NONE}}, + {"rmdir",cmd_rmdir," remove a directory",{COMPL_NONE,COMPL_NONE}}, {"setmode",cmd_setmode,"filename change modes of file",{COMPL_REMOTE,COMPL_NONE}}, - {"help",cmd_help,"[command] give help on a command",{COMPL_NONE,COMPL_NONE}}, + {"tar",cmd_tar,"tar [IXFqbgNan] current directory to/from ",{COMPL_NONE,COMPL_NONE}}, + {"tarmode",cmd_tarmode," tar's behaviour towards archive bits",{COMPL_NONE,COMPL_NONE}}, + {"translate",cmd_translate,"toggle text translation for printing",{COMPL_NONE,COMPL_NONE}}, {"?",cmd_help,"[command] give help on a command",{COMPL_NONE,COMPL_NONE}}, - {"history",cmd_history,"displays the command history",{COMPL_NONE,COMPL_NONE}}, {"!",NULL,"run a shell command on the local system",{COMPL_NONE,COMPL_NONE}}, {"",NULL,NULL,{COMPL_NONE,COMPL_NONE}} }; -- cgit