Commit 99110483 authored by unknown's avatar unknown

Various fixups, readability improved.


client/mysqladmin.c:
  Fixed up enums, arrays, and structs.  Much more readable.
  Corrected copyright notice on one version output.
  Corrected english on program description.
parent dc46db58
......@@ -75,30 +75,37 @@ static void store_values(MYSQL_RES *result);
The order of commands must be the same as command_names,
except ADMIN_ERROR
*/
enum commands { ADMIN_ERROR, ADMIN_CREATE, ADMIN_DROP, ADMIN_SHUTDOWN,
ADMIN_RELOAD, ADMIN_REFRESH, ADMIN_VER, ADMIN_PROCESSLIST,
ADMIN_STATUS, ADMIN_KILL, ADMIN_DEBUG, ADMIN_VARIABLES,
ADMIN_FLUSH_LOGS, ADMIN_FLUSH_HOSTS, ADMIN_FLUSH_TABLES,
ADMIN_PASSWORD, ADMIN_PING, ADMIN_EXTENDED_STATUS,
ADMIN_FLUSH_STATUS, ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE,
ADMIN_STOP_SLAVE, ADMIN_FLUSH_THREADS
enum commands {
ADMIN_ERROR,
ADMIN_CREATE, ADMIN_DROP, ADMIN_SHUTDOWN,
ADMIN_RELOAD, ADMIN_REFRESH, ADMIN_VER,
ADMIN_PROCESSLIST, ADMIN_STATUS, ADMIN_KILL,
ADMIN_DEBUG, ADMIN_VARIABLES, ADMIN_FLUSH_LOGS,
ADMIN_FLUSH_HOSTS, ADMIN_FLUSH_TABLES, ADMIN_PASSWORD,
ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS,
ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE,
ADMIN_FLUSH_THREADS
};
static const char *command_names[]=
{"create","drop","shutdown","reload","refresh",
"version", "processlist","status","kill","debug",
"variables","flush-logs","flush-hosts",
"flush-tables","password","ping",
"extended-status","flush-status",
"flush-privileges", "start-slave","stop-slave", "flush-threads", NullS};
static const char *command_names[]= {
"create", "drop", "shutdown",
"reload", "refresh", "version",
"processlist", "status", "kill",
"debug", "variables", "flush-logs",
"flush-hosts", "flush-tables", "password",
"ping", "extended-status", "flush-status",
"flush-privileges", "start-slave", "stop-slave",
"flush-threads",
NullS
};
static TYPELIB command_typelib=
{ array_elements(command_names)-1,"commands", command_names};
enum options { OPT_CHARSETS_DIR=256 };
static struct option long_options[] =
{
static struct option long_options[] = {
{"compress", no_argument, 0, 'C'},
{"character-sets-dir",required_argument, 0, OPT_CHARSETS_DIR},
{"character-sets-dir", required_argument, 0, OPT_CHARSETS_DIR},
{"debug", optional_argument, 0, '#'},
{"force", no_argument, 0, 'f'},
{"help", no_argument, 0, '?'},
......@@ -457,7 +464,8 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
case ADMIN_VER:
new_line=1;
print_version();
puts("TCX Datakonsult AB, by Monty\n");
puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB");
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");
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
printf("Connection\t\t%s\n",mysql_get_host_info(mysql));
......@@ -755,7 +763,7 @@ static void usage(void)
print_version();
puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB");
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("Administer program for the mysqld demon");
puts("Administration program for the mysqld daemon.");
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
printf("\n\
-#, --debug=... Output debug log. Often this is 'd:t:o,filename`\n\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment