X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fgtkwin.c;h=bd69fb698b3fe2110e61b3d9cb37129c433aa27e;hb=3e22c99c9a3c28e042f2dc3a50fadf95e7c277e7;hp=2c0df9cb220d8910324c5c8e2d5329d27d3aa7ac;hpb=d5836982e23d8a6176114e1073469950c4eaae37;p=PuTTY.git diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 2c0df9cb..bd69fb69 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -2592,6 +2592,13 @@ static void help(FILE *fp) { } } +static void version(FILE *fp) { + if(fprintf(fp, "%s: %s\n", appname, ver) < 0 || fflush(fp) < 0) { + perror("output error"); + exit(1); + } +} + int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch, struct gui_data *inst, Conf *conf) { @@ -2801,6 +2808,10 @@ int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch, help(stdout); exit(0); + } else if(!strcmp(p, "-version") || !strcmp(p, "--version")) { + version(stdout); + exit(0); + } else if (!strcmp(p, "-pgpfp")) { pgp_fingerprints(); exit(1);