diff options
Diffstat (limited to 'client/mysqlshow.c')
-rw-r--r-- | client/mysqlshow.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 8c64d61ded2..8cd70db1424 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ #include <signal.h> #include <stdarg.h> #include <sslopt-vars.h> +#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ static char * host=0, *opt_password=0, *user=0; static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0; @@ -32,7 +33,7 @@ static my_bool tty_password= 0, opt_table_type= 0; static my_bool debug_info_flag= 0, debug_check_flag= 0; static uint my_end_arg= 0; static uint opt_verbose=0; -static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; +static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; #ifdef HAVE_SMEM static char *shared_memory_base_name=0; @@ -63,7 +64,9 @@ int main(int argc, char **argv) char *wild; MYSQL mysql; MY_INIT(argv[0]); - load_defaults("my",load_default_groups,&argc,&argv); + if (load_defaults("my",load_default_groups,&argc,&argv)) + exit(1); + get_options(&argc,&argv); wild=0; @@ -147,10 +150,9 @@ int main(int argc, char **argv) break; } mysql_close(&mysql); /* Close & free connection */ - if (opt_password) - my_free(opt_password,MYF(0)); + my_free(opt_password); #ifdef HAVE_SMEM - my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(shared_memory_base_name); #endif my_end(my_end_arg); exit(error ? 1 : 0); @@ -159,10 +161,6 @@ int main(int argc, char **argv) static struct my_option my_long_options[] = { -#ifdef __NETWARE__ - {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, -#endif {"character-sets-dir", 'c', "Directory for character set files.", &charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -239,22 +237,18 @@ static struct my_option my_long_options[] = {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; - -#include <help_start.h> static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); - NETWARE_SET_SCREEN_MODE(1); } static void usage(void) { print_version(); - puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc."); - puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n"); + puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010)")); puts("Shows the structure of a MySQL database (databases, tables, and columns).\n"); printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname); puts("\n\ @@ -269,18 +263,12 @@ are shown."); my_print_variables(my_long_options); } -#include <help_end.h> static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { switch(optid) { -#ifdef __NETWARE__ - case OPT_AUTO_CLOSE: - setscreenmode(SCR_AUTOCLOSE_ON_EXIT); - break; -#endif case 'v': opt_verbose++; break; @@ -290,7 +278,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start=argument; - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password=my_strdup(argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) |