X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/f11233cb78347e3e7ad9c4834f75a4f6923100a9..fc0f17db91f32c7504756e92a411a60d2ef0e264:/psftp.c diff --git a/psftp.c b/psftp.c index 6812574d..b134c503 100644 --- a/psftp.c +++ b/psftp.c @@ -1,5 +1,5 @@ /* - * psftp.c: front end for PSFTP. + * psftp.c: (platform-independent) front end for PSFTP. */ #include @@ -1765,7 +1765,7 @@ static void usage(void) { printf("PuTTY Secure File Transfer (SFTP) client\n"); printf("%s\n", ver); - printf("Usage: psftp [options] user@host\n"); + printf("Usage: psftp [options] [user@]host\n"); printf("Options:\n"); printf(" -b file use specified batchfile\n"); printf(" -bc output batchfile commands\n"); @@ -1779,9 +1779,16 @@ static void usage(void) printf(" -C enable compression\n"); printf(" -i key private key file for authentication\n"); printf(" -batch disable all interactive prompts\n"); + printf(" -V print version information\n"); cleanup_exit(1); } +static void version(void) +{ + printf("psftp: %s\n", ver); + cleanup_exit(1); +} + /* * Connect to a host. */ @@ -2010,6 +2017,8 @@ int psftp_main(int argc, char *argv[]) } else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-?") == 0) { usage(); + } else if (strcmp(argv[i], "-V") == 0) { + version(); } else if (strcmp(argv[i], "-batch") == 0) { console_batch_mode = 1; } else if (strcmp(argv[i], "-b") == 0 && i + 1 < argc) {