Fixed Bug#1472, mysql \h output out of order.

parent 210a8750
......@@ -227,11 +227,12 @@ typedef struct {
} COMMANDS;
static COMMANDS commands[] = {
{ "help", 'h', com_help, 1, "Display this help." },
{ "?", '?', com_help, 1, "Synonym for `help'." },
{ "clear", 'c', com_clear, 0, "Clear command."},
{ "connect",'r', com_connect,1,
"Reconnect to the server. Optional arguments are db and host." },
{ "delimiter", 'd', com_delimiter, 1,
"Set query delimiter. " },
#ifdef USE_POPEN
{ "edit", 'e', com_edit, 0, "Edit command with $EDITOR."},
#endif
......@@ -239,6 +240,7 @@ static COMMANDS commands[] = {
"Send command to mysql server, display result vertically."},
{ "exit", 'q', com_quit, 0, "Exit mysql. Same as quit."},
{ "go", 'g', com_go, 0, "Send command to mysql server." },
{ "help", 'h', com_help, 1, "Display this help." },
#ifdef USE_POPEN
{ "nopager",'n', com_nopager,0, "Disable pager, print to stdout." },
#endif
......@@ -261,8 +263,6 @@ static COMMANDS commands[] = {
"Set outfile [to_outfile]. Append everything into given outfile." },
{ "use", 'u', com_use, 1,
"Use another database. Takes database name as argument." },
{ "delimiter", 'd', com_delimiter, 1,
"Set query delimiter. " },
/* Get bash-like expansion for some commands */
{ "create table", 0, 0, 0, ""},
{ "create database", 0, 0, 0, ""},
......@@ -1577,8 +1577,8 @@ static int
com_help(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
reg1 int i;
char * help_arg= strchr(line,' ');
reg1 int i, j;
char * help_arg= strchr(line,' '), buff[32], *end;
if (help_arg)
return com_server_help(buffer,line,help_arg+1);
......@@ -1591,8 +1591,11 @@ com_help(String *buffer __attribute__((unused)),
put_info("Note that all text commands must be first on line and end with ';'",INFO_INFO);
for (i = 0; commands[i].name; i++)
{
end= strmov(buff, commands[i].name);
for (j= strlen(commands[i].name); j < 10; j++)
end= strmov(end, " ");
if (commands[i].func)
tee_fprintf(stdout, "%s\t(\\%c)\t%s\n", commands[i].name,
tee_fprintf(stdout, "%s(\\%c) %s\n", buff,
commands[i].cmd_char, commands[i].doc);
}
if (connected && mysql_get_server_version(&mysql) >= 40100)
......
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