Add the `pwd' command in PSFTP.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 9 Sep 2001 16:31:26 +0000 (16:31 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 9 Sep 2001 16:31:26 +0000 (16:31 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@1262 cda61777-01e9-0310-a592-d414129be87e

psftp.c

diff --git a/psftp.c b/psftp.c
index ebfb8ef..37f39ff 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -276,6 +276,15 @@ int sftp_cmd_cd(struct sftp_command *cmd)
 }
 
 /*
+ * Print current directory. Easy as pie.
+ */
+int sftp_cmd_pwd(struct sftp_command *cmd)
+{
+    printf("Remote directory is %s\n", pwd);
+    return 0;
+}
+
+/*
  * Get a file and save it at the local end. We have two very
  * similar commands here: `get' and `reget', which differ in that
  * `reget' checks for the existence of the destination file and
@@ -919,6 +928,12 @@ static struct sftp_cmd_lookup {
            sftp_cmd_put
     },
     {
+       "pwd", "print your remote working directory",
+           "\n"
+           "  Print the current remote working directory for your SFTP session.\n",
+           sftp_cmd_pwd
+    },
+    {
        "quit", "bye", NULL,
            sftp_cmd_quit
     },