aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2000-05-11 03:14:19 +0000
committerBruce Momjian <bruce@momjian.us>2000-05-11 03:14:19 +0000
commite10c5597b72435ac4ddb7d7b10858b85d6af0908 (patch)
tree3a2e9149adbfff83ff80afadc9ca506b10c03d20
parent0fbde5d9286f5cea617fc857cddd423f2084f5d5 (diff)
downloadpostgresql-e10c5597b72435ac4ddb7d7b10858b85d6af0908.tar.gz
postgresql-e10c5597b72435ac4ddb7d7b10858b85d6af0908.zip
Display -? as -\? under unix for psql.
-rw-r--r--src/bin/psql/startup.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index a886782c8a4..252caa2ff67 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);
+}
+