diff options
author | unknown <jani@rhols221.adsl.netsonic.fi> | 2003-12-30 17:58:39 +0200 |
---|---|---|
committer | unknown <jani@rhols221.adsl.netsonic.fi> | 2003-12-30 17:58:39 +0200 |
commit | 8b4e00ffb7dbb1bcec6619d577d46090d9f94cce (patch) | |
tree | 8c069c91c03c39432214eaf11e9650423d0d3f4f /client | |
parent | c7b62fcde712852f0797bad7aba9e731b441a1fe (diff) | |
download | mariadb-git-8b4e00ffb7dbb1bcec6619d577d46090d9f94cce.tar.gz |
Fixed Bug#1472, mysql \h output out of order.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index d2bed5519bf..e3945e8aa2f 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -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) |