]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Add the `pwd' command in PSFTP.
authorSimon Tatham <anakin@pobox.com>
Sun, 9 Sep 2001 16:31:26 +0000 (16:31 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 9 Sep 2001 16:31:26 +0000 (16:31 +0000)
[originally from svn r1262]

psftp.c

diff --git a/psftp.c b/psftp.c
index ebfb8ef65bfa5751fe2708fc47a241f22943bba6..37f39ff3fdd0eb171c0e572ad1b16b7b09433ce8 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -275,6 +275,15 @@ int sftp_cmd_cd(struct sftp_command *cmd)
     return 0;
 }
 
+/*
+ * 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
@@ -918,6 +927,12 @@ static struct sftp_cmd_lookup {
            "  argument <remote-filename>.\n",
            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