X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/dbe6c525a19dc7b52ff9f6bfb1f64da7579689d3..33f07e9636e80bb17f25f97145ca2e0eb262db30:/plink.c diff --git a/plink.c b/plink.c index 37113762..92769e86 100644 --- 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 @@ -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; @@ -555,7 +564,7 @@ int main(int argc, char **argv) (GetFileType(GetStdHandle(STD_INPUT_HANDLE)) == FILE_TYPE_CHAR); error = back->init(NULL, &backhandle, &cfg, cfg.host, cfg.port, - &realhost, nodelay); + &realhost, nodelay, cfg.tcp_keepalives); if (error) { fprintf(stderr, "Unable to open connection:\n%s", error); return 1;