3
3
*
4
4
* Copyright 2000 by PostgreSQL Global Development Group
5
5
*
6
- * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.30 2000/05/1101:37:54 momjian Exp $
6
+ * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.31 2000/05/1103:14:19 momjian Exp $
7
7
*/
8
8
#include "postgres.h"
9
9
@@ -82,7 +82,8 @@ static void
82
82
static void
83
83
showVersion (void );
84
84
85
-
85
+ static void
86
+ explain_help_and_exit (void );
86
87
87
88
/*
88
89
*
@@ -513,8 +514,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
513
514
/* unknown option reported by getopt */
514
515
else
515
516
{
516
- fputs ("Try -? for help.\n" ,stderr );
517
- exit (EXIT_FAILURE );
517
+ explain_help_and_exit ();
518
518
}
519
519
break ;
520
520
#ifndef HAVE_GETOPT_LONG
@@ -525,8 +525,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
525
525
break ;
526
526
#endif
527
527
default :
528
- fputs ("Try -? for help.\n" ,stderr );
529
- exit (EXIT_FAILURE );
528
+ explain_help_and_exit ();
530
529
break ;
531
530
}
532
531
}
@@ -640,3 +639,17 @@ showVersion(void)
640
639
puts ("Read the file COPYRIGHT or use the command \\copyright to see the" );
641
640
puts ("usage and distribution terms." );
642
641
}
642
+
643
+ static void
644
+ explain_help_and_exit (void )
645
+ {
646
+
647
+ #ifdef WIN32
648
+ fputs ("Try -? for help.\n" ,stderr );
649
+ #else /* !WIN32 */
650
+ fputs ("Try -\\? for help.\n" ,stderr );
651
+ #endif /* WIN32 */
652
+
653
+ exit (EXIT_FAILURE );
654
+ }
655
+