Various tweaks to header comments to remind me which bits are meant to be
[u/mdw/putty] / plink.c
diff --git a/plink.c b/plink.c
index 3711376..a0a9541 100644 (file)
--- a/plink.c
+++ b/plink.c
@@ -1,5 +1,5 @@
 /*
- * PLink - a command-line (stdin/stdout) variant of PuTTY.
+ * PLink - a Windows command-line (stdin/stdout) variant of PuTTY.
  */
 
 #include <stdio.h>
@@ -210,6 +210,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");
@@ -236,6 +237,12 @@ static void usage(void)
     exit(1);
 }
 
+static void version(void)
+{
+    printf("plink: %s\n", ver);
+    exit(1);
+}
+
 char *do_select(SOCKET skt, int startup)
 {
     int events;
@@ -326,6 +333,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 {
                fprintf(stderr, "plink: unknown option \"%s\"\n", p);
                errors = 1;