Skip to content

Commit 06b8043

Browse files
committed
Remove undocumented -h (help) option
The -h option was not supported by many tools, and not documented, so remove them for consistency from pg_upgrade, pg_test_fsync, and pg_test_timing.
1 parent 031cc55 commit 06b8043

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

contrib/pg_test_fsync/pg_test_fsync.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ handle_args(int argc, char *argv[])
146146

147147
if (argc > 1)
148148
{
149-
if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0 ||
150-
strcmp(argv[1], "-?") == 0)
149+
if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
151150
{
152151
printf("Usage: %s [-f FILENAME] [-s SECS-PER-TEST]\n", progname);
153152
exit(0);

contrib/pg_test_timing/pg_test_timing.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ handle_args(int argc, char *argv[])
4949

5050
if (argc > 1)
5151
{
52-
if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0 ||
53-
strcmp(argv[1], "-?") == 0)
52+
if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
5453
{
5554
printf("Usage: %s [-d DURATION]\n", progname);
5655
exit(0);

src/bin/pg_ctl/pg_ctl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,13 +2002,12 @@ main(int argc, char **argv)
20022002
/* support --help and --version even if invoked as root */
20032003
if (argc > 1)
20042004
{
2005-
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 ||
2006-
strcmp(argv[1], "-?") == 0)
2005+
if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
20072006
{
20082007
do_help();
20092008
exit(0);
20102009
}
2011-
else if (strcmp(argv[1], "-V") == 0 || strcmp(argv[1], "--version") == 0)
2010+
else if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
20122011
{
20132012
puts("pg_ctl (PostgreSQL) " PG_VERSION);
20142013
exit(0);

src/bin/psql/startup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
558558
break;
559559
case '?':
560560
/* Actual help option given */
561-
if (strcmp(argv[optind - 1], "-?") == 0 || strcmp(argv[optind - 1], "--help") == 0)
561+
if (strcmp(argv[optind - 1], "--help") == 0 || strcmp(argv[optind - 1], "-?") == 0)
562562
{
563563
usage();
564564
exit(EXIT_SUCCESS);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy