diff options
author | jani@ua141d10.elisa.omakaista.fi <> | 2007-03-19 11:19:51 +0200 |
---|---|---|
committer | jani@ua141d10.elisa.omakaista.fi <> | 2007-03-19 11:19:51 +0200 |
commit | 71c7035035b8cfeb6f28cd058dd67116bfd9ed33 (patch) | |
tree | 9a5138fc2c9b3da679d046cb6fd0419bb6f5042b /client/mysqlcheck.c | |
parent | 94f0977b869b9a2d98f42fca723613d8cef0f783 (diff) | |
download | mariadb-git-71c7035035b8cfeb6f28cd058dd67116bfd9ed33.tar.gz |
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.
Diffstat (limited to 'client/mysqlcheck.c')
-rw-r--r-- | client/mysqlcheck.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 1a9d07804b4..41c5cde4023 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -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; } |