Author: gd Date: 2007-07-11 08:43:08 +0000 (Wed, 11 Jul 2007) New Revision: 23825
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23825 Log: Add ".." command as an alias to "cd ..". Guenther Modified: branches/SAMBA_3_2/source/client/client.c branches/SAMBA_3_2_0/source/client/client.c Changeset: Modified: branches/SAMBA_3_2/source/client/client.c =================================================================== --- branches/SAMBA_3_2/source/client/client.c 2007-07-11 08:31:03 UTC (rev 23824) +++ branches/SAMBA_3_2/source/client/client.c 2007-07-11 08:43:08 UTC (rev 23825) @@ -343,6 +343,19 @@ return rc; } +/**************************************************************************** + Change directory. +****************************************************************************/ + +static int cmd_cd_oneup(void) +{ + pstring buf; + + pstrcpy(buf, ".."); + return do_cd(buf); +} + + /******************************************************************* Decide if a file should be operated on. ********************************************************************/ @@ -3308,7 +3321,8 @@ {"logon",cmd_logon,"establish new logon",{COMPL_NONE,COMPL_NONE}}, {"listconnect",cmd_list_connect,"list open connections",{COMPL_NONE,COMPL_NONE}}, {"showconnect",cmd_show_connect,"display the current active connection",{COMPL_NONE,COMPL_NONE}}, - + {"..",cmd_cd_oneup,"change the remote directory (up one level)",{COMPL_REMOTE,COMPL_NONE}}, + /* Yes, this must be here, see crh's comment above. */ {"!",NULL,"run a shell command on the local system",{COMPL_NONE,COMPL_NONE}}, {NULL,NULL,NULL,{COMPL_NONE,COMPL_NONE}} Modified: branches/SAMBA_3_2_0/source/client/client.c =================================================================== --- branches/SAMBA_3_2_0/source/client/client.c 2007-07-11 08:31:03 UTC (rev 23824) +++ branches/SAMBA_3_2_0/source/client/client.c 2007-07-11 08:43:08 UTC (rev 23825) @@ -343,6 +343,19 @@ return rc; } +/**************************************************************************** + Change directory. +****************************************************************************/ + +static int cmd_cd_oneup(void) +{ + pstring buf; + + pstrcpy(buf, ".."); + return do_cd(buf); +} + + /******************************************************************* Decide if a file should be operated on. ********************************************************************/ @@ -3259,7 +3272,8 @@ {"logon",cmd_logon,"establish new logon",{COMPL_NONE,COMPL_NONE}}, {"listconnect",cmd_list_connect,"list open connections",{COMPL_NONE,COMPL_NONE}}, {"showconnect",cmd_show_connect,"display the current active connection",{COMPL_NONE,COMPL_NONE}}, - + {"..",cmd_cd_oneup,"change the remote directory (up one level)",{COMPL_REMOTE,COMPL_NONE}}, + /* Yes, this must be here, see crh's comment above. */ {"!",NULL,"run a shell command on the local system",{COMPL_NONE,COMPL_NONE}}, {NULL,NULL,NULL,{COMPL_NONE,COMPL_NONE}}