Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite10c559

Browse files
committed
Display -? as -\? under unix for psql.
1 parent0fbde5d commite10c559

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

‎src/bin/psql/startup.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
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 $
77
*/
88
#include"postgres.h"
99

@@ -82,7 +82,8 @@ static void
8282
staticvoid
8383
showVersion(void);
8484

85-
85+
staticvoid
86+
explain_help_and_exit(void);
8687

8788
/*
8889
*
@@ -513,8 +514,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
513514
/* unknown option reported by getopt */
514515
else
515516
{
516-
fputs("Try -? for help.\n",stderr);
517-
exit(EXIT_FAILURE);
517+
explain_help_and_exit();
518518
}
519519
break;
520520
#ifndefHAVE_GETOPT_LONG
@@ -525,8 +525,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
525525
break;
526526
#endif
527527
default:
528-
fputs("Try -? for help.\n",stderr);
529-
exit(EXIT_FAILURE);
528+
explain_help_and_exit();
530529
break;
531530
}
532531
}
@@ -640,3 +639,17 @@ showVersion(void)
640639
puts("Read the file COPYRIGHT or use the command \\copyright to see the");
641640
puts("usage and distribution terms.");
642641
}
642+
643+
staticvoid
644+
explain_help_and_exit(void)
645+
{
646+
647+
#ifdefWIN32
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+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp