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.
This commit is contained in:
Bruce Momjian 2013-07-01 12:40:02 -04:00
parent 031cc55bbe
commit 06b804377c
4 changed files with 5 additions and 8 deletions

View 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);

View 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);

View 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);

View 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);