]> granicus.if.org Git - postgresql/commitdiff
Remove undocumented -h (help) option
authorBruce Momjian <bruce@momjian.us>
Mon, 1 Jul 2013 16:40:02 +0000 (12:40 -0400)
committerBruce Momjian <bruce@momjian.us>
Mon, 1 Jul 2013 16:40:33 +0000 (12:40 -0400)
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.

contrib/pg_test_fsync/pg_test_fsync.c
contrib/pg_test_timing/pg_test_timing.c
src/bin/pg_ctl/pg_ctl.c
src/bin/psql/startup.c

index b978d9e44efab79e39d685d1ebcd2a61205d3d66..53f600f593d98d2d9dc4bbdacd77a88938feede5 100644 (file)
@@ -146,8 +146,7 @@ handle_args(int argc, char *argv[])
 
        if (argc > 1)
        {
-               if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0 ||
-                       strcmp(argv[1], "-?") == 0)
+               if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
                {
                        printf("Usage: %s [-f FILENAME] [-s SECS-PER-TEST]\n", progname);
                        exit(0);
index 0bf9127e105a8cd53cfcd86cb466205893faae67..e44c535d09305cca568f28e3802ffcfcb73a08e4 100644 (file)
@@ -49,8 +49,7 @@ handle_args(int argc, char *argv[])
 
        if (argc > 1)
        {
-               if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0 ||
-                       strcmp(argv[1], "-?") == 0)
+               if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
                {
                        printf("Usage: %s [-d DURATION]\n", progname);
                        exit(0);
index 9045e00a1dba8468b6ade31967e4a71d9739d660..9e909ae77d18816a296f0abe3e05af6ce3aa7325 100644 (file)
@@ -2002,13 +2002,12 @@ main(int argc, char **argv)
        /* support --help and --version even if invoked as root */
        if (argc > 1)
        {
-               if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 ||
-                       strcmp(argv[1], "-?") == 0)
+               if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
                {
                        do_help();
                        exit(0);
                }
-               else if (strcmp(argv[1], "-V") == 0 || strcmp(argv[1], "--version") == 0)
+               else if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
                {
                        puts("pg_ctl (PostgreSQL) " PG_VERSION);
                        exit(0);
index 1c9f7a568a1574dd9318015bf9fc02b7b2a0012e..b2264c91fac95611ad1faef7e93fd91f078c2ee2 100644 (file)
@@ -558,7 +558,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
                                break;
                        case '?':
                                /* Actual help option given */
-                               if (strcmp(argv[optind - 1], "-?") == 0 || strcmp(argv[optind - 1], "--help") == 0)
+                               if (strcmp(argv[optind - 1], "--help") == 0 || strcmp(argv[optind - 1], "-?") == 0)
                                {
                                        usage();
                                        exit(EXIT_SUCCESS);