Arnaud Desitter points out a silly mistake in retrieve_cutbuffer()
[sgt/putty] / unix / uxplink.c
index 1691933..e59a701 100644 (file)
@@ -208,6 +208,7 @@ static void usage(void)
     printf("Usage: plink [options] [user@]host [command]\n");
     printf("       (\"host\" can also be a PuTTY saved session name)\n");
     printf("Options:\n");
+    printf("  -V        print version information\n");
     printf("  -v        show verbose messages\n");
     printf("  -load sessname  Load settings from saved session\n");
     printf("  -ssh -telnet -rlogin -raw\n");
@@ -234,6 +235,12 @@ static void usage(void)
     exit(1);
 }
 
+static void version(void)
+{
+    printf("plink: %s\n", ver);
+    exit(1);
+}
+
 int main(int argc, char **argv)
 {
     int sending;
@@ -301,6 +308,8 @@ int main(int argc, char **argv)
            } else if (!strcmp(p, "-s")) {
                 /* Save status to write to cfg later. */
                use_subsystem = 1;
+           } else if (!strcmp(p, "-V")) {
+                version();
            } else if (!strcmp(p, "-o")) {
                 if (argc <= 1) {
                     fprintf(stderr,