From c6a38a2557296c053d51a93d94b8213fded67aff Mon Sep 17 00:00:00 2001 From: "gluh@gluh.mysql.r18.ru" <> Date: Fri, 25 Jul 2003 11:03:57 +0500 Subject: [PATCH] Bug#909: mysqld --verbose --help != mysqld --help --verbose Proposed fix for bug#909 --- sql/mysqld.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index bdbbdd18baf..f44d589d9b2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -229,6 +229,7 @@ bool opt_large_files= sizeof(my_off_t) > 4; /* Used with --help for detailed option */ +bool opt_help= 0; bool opt_verbose= 0; arg_cmp_func Arg_comparator::comparator_matrix[4][2] = @@ -3642,8 +3643,9 @@ Disable with --skip-bdb (will save memory).", "Percentage of dirty pages allowed in bufferpool.", (gptr*) &srv_max_buf_pool_modified_pct, (gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0}, #endif /* End HAVE_INNOBASE_DB */ - {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, - 0, 0, 0, 0, 0}, + {"help", '?', "Display this help and exit.", + (gptr*) &opt_help, (gptr*) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, + 0, 0}, {"verbose", 'v', "Used with --help option for detailed help", (gptr*) &opt_verbose, (gptr*) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -4882,16 +4884,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; #endif #include - case 'v': - usage(); - exit(0); case 'V': print_version(); exit(0); - case 'I': - case '?': - usage(); - exit(0); case 'T': test_flags= argument ? (uint) atoi(argument) : 0; test_flags&= ~TEST_NO_THREADS; @@ -5365,6 +5360,11 @@ static void get_options(int argc,char **argv) exit(ho_error); } + if (opt_verbose || opt_help) + { + usage(); + exit(0); + } #if defined(HAVE_BROKEN_REALPATH) my_use_symdir=0; my_disable_symlinks=1;