add lpwd command

This commit is contained in:
Kelvin Sherlock 2012-09-08 17:04:47 -04:00
parent b5dc0fa710
commit faef86c362
3 changed files with 15 additions and 0 deletions

View File

@ -987,6 +987,18 @@ static char buf[MAXPATHLEN];
code = 0;
}
void lpwd(int argc, char **argv)
{
static char buf[MAXPATHLEN];
if (getcwd(buf, sizeof(buf)) != NULL)
printf("Local directory %s\n", buf);
else
fprintf(stderr, "getcwd: %s\n", strerror(errno));
code = 0;
}
/*
* Delete a single file.
*/

View File

@ -45,6 +45,7 @@ void mget (int argc, char **argv);
void status (int argc, char **argv);
void cd (int argc, char **argv);
void lcd (int argc, char **argv);
void lpwd (int argc, char **argv);
void delete (int argc, char **argv);
void mdelete (int argc, char **argv);
void renamefile (int argc, char **argv);

View File

@ -34,6 +34,7 @@ char hashhelp[] = "toggle printing `#' for each buffer transferred";
char helphelp[] = "print local help information";
char idlehelp[] = "get (set) idle timer on remote side";
char lcdhelp[] = "change local working directory";
char lpwdhelp[] = "print local working directory";
char lshelp[] = "list contents of remote directory";
char macdefhelp[] = "define a macro";
char mdeletehelp[] = "delete multiple files";
@ -105,6 +106,7 @@ struct cmd cmdtab[] = {
{ "idle", idlehelp, 0, 1, 1, idle },
{ "image", binaryhelp, 0, 1, 1, setbinary },
{ "lcd", lcdhelp, 0, 0, 0, lcd },
{ "lpwd", lpwdhelp, 0, 0, 0, lpwd },
{ "ls", lshelp, 1, 1, 1, ls },
{ "macdef", macdefhelp, 0, 0, 0, macdef },
{ "mdelete", mdeletehelp, 1, 1, 1, mdelete },