76
76
NO_ARG, 0, 0, 0, 0, 0, 0},
77
77
{"host", 'h', N_("Connect to host."), (char**) &host, (char**) &host, 0, GET_STR,
78
78
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
80
80
N_("Password to use when connecting to server. If password is not given it's asked from the tty."),
81
81
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
82
{"port", 'P', N_("Port number to use for connection or 0 for default to, in "
82
{"port", 'p', N_("Port number to use for connection or 0 for default to, in "
83
83
"order of preference, drizzle.cnf, $DRIZZLE_TCP_PORT, "
84
84
"built-in default (" STRINGIFY_ARG(DRIZZLE_PORT) ")."),
86
(char**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
85
0, 0, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
87
86
{"silent", 's', N_("Silently exit if one can't connect to server."),
88
87
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
89
88
#ifndef DONT_ALLOW_USER_CHANGE
112
111
get_one_option(int optid, const struct my_option *, char *argument)
114
uint64_t temp_drizzle_port= 0;
119
temp_drizzle_port= (uint64_t) strtoul(argument, &endchar, 10);
120
/* if there is an alpha character this is not a valid port */
121
if (strlen(endchar) != 0)
123
fprintf(stderr, _("Non-integer value supplied for port. If you are trying to enter a password please use --password instead.\n"));
126
/* If the port number is > 65535 it is not a valid port
127
This also helps with potential data loss casting unsigned long to a
129
if ((temp_drizzle_port == 0) || (temp_drizzle_port > 65535))
131
fprintf(stderr, _("Value supplied for port is not valid.\n"));
136
tcp_port= (uint32_t) temp_drizzle_port;
120
142
char *start=argument;