From 71c7035035b8cfeb6f28cd058dd67116bfd9ed33 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Mon, 19 Mar 2007 11:19:51 +0200 Subject: 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. --- client/mysqlshow.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'client/mysqlshow.c') diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 1c714cc640f..0c6a6229964 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -287,14 +287,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); - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); break; - } case '#': DBUG_PUSH(argument ? argument : "d:t:o"); break; -- cgit v1.2.1