From e10c5597b72435ac4ddb7d7b10858b85d6af0908 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 11 May 2000 03:14:19 +0000 Subject: [PATCH] Display -? as -\? under unix for psql. --- src/bin/psql/startup.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index a886782c8a..252caa2ff6 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.30 2000/05/11 01:37:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.31 2000/05/11 03:14:19 momjian Exp $ */ #include "postgres.h" @@ -82,7 +82,8 @@ static void static void showVersion(void); - +static void + explain_help_and_exit(void); /* * @@ -513,8 +514,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) /* unknown option reported by getopt */ else { - fputs("Try -? for help.\n", stderr); - exit(EXIT_FAILURE); + explain_help_and_exit(); } break; #ifndef HAVE_GETOPT_LONG @@ -525,8 +525,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) break; #endif default: - fputs("Try -? for help.\n", stderr); - exit(EXIT_FAILURE); + explain_help_and_exit(); break; } } @@ -640,3 +639,17 @@ showVersion(void) puts("Read the file COPYRIGHT or use the command \\copyright to see the"); puts("usage and distribution terms."); } + +static void +explain_help_and_exit(void) +{ + +#ifdef WIN32 + fputs("Try -? for help.\n", stderr); +#else /* !WIN32 */ + fputs("Try -\\? for help.\n", stderr); +#endif /* WIN32 */ + + exit(EXIT_FAILURE); +} +