mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Added find_type_or_exit and find_bit_type_or_exit as wrappers
around the original functions. These will ensure that error message is always in unique form, reduce code and print the right alternatives automatically in an error case.
This commit is contained in:
@ -568,14 +568,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
#endif
|
||||
break;
|
||||
case OPT_MYSQL_PROTOCOL:
|
||||
{
|
||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
||||
{
|
||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||
opt->name);
|
||||
break;
|
||||
case '#':
|
||||
DBUG_PUSH(argument ? argument : default_dbug_option);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user