Commit d3e3bb77 authored by Monty's avatar Monty

Print value of 'protocol' option in --help

parent 5f34513c
...@@ -198,6 +198,7 @@ static uint delimiter_length= 1; ...@@ -198,6 +198,7 @@ static uint delimiter_length= 1;
unsigned short terminal_width= 80; unsigned short terminal_width= 80;
static uint opt_protocol=0; static uint opt_protocol=0;
static const char *opt_protocol_type= "";
static CHARSET_INFO *charset_info= &my_charset_latin1; static CHARSET_INFO *charset_info= &my_charset_latin1;
#include "sslopt-vars.h" #include "sslopt-vars.h"
...@@ -1604,7 +1605,8 @@ static struct my_option my_long_options[] = ...@@ -1604,7 +1605,8 @@ static struct my_option my_long_options[] =
&current_prompt, &current_prompt, 0, GET_STR_ALLOC, &current_prompt, &current_prompt, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe).", {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_protocol_type, &opt_protocol_type, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"quick", 'q', {"quick", 'q',
"Don't cache result, print it row by row. This may slow down the server " "Don't cache result, print it row by row. This may slow down the server "
"if the output is suspended. Doesn't use history file.", "if the output is suspended. Doesn't use history file.",
...@@ -1785,7 +1787,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -1785,7 +1787,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break; break;
case OPT_MYSQL_PROTOCOL: case OPT_MYSQL_PROTOCOL:
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib, if (!argument[0])
opt_protocol= 0;
else if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0) opt->name)) <= 0)
exit(1); exit(1);
#endif #endif
...@@ -1873,6 +1877,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -1873,6 +1877,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'W': case 'W':
#ifdef __WIN__ #ifdef __WIN__
opt_protocol = MYSQL_PROTOCOL_PIPE; opt_protocol = MYSQL_PROTOCOL_PIPE;
opt_protcol_type= "pipe";
#endif #endif
break; break;
#include <sslopt-case.h> #include <sslopt-case.h>
......
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