1
0
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:
jani@ua141d10.elisa.omakaista.fi
2007-03-19 11:19:51 +02:00
parent 94f0977b86
commit 71c7035035
12 changed files with 89 additions and 130 deletions

View File

@ -310,15 +310,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case 'V': print_version(); exit(0);
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);
}
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
break;
}
}
return 0;
}