diff options
| author | Benoit Mortier <opensides@users.sourceforge.net> | 2004-12-01 23:54:51 +0000 |
|---|---|---|
| committer | Benoit Mortier <opensides@users.sourceforge.net> | 2004-12-01 23:54:51 +0000 |
| commit | d19edd4043c498626fe68308005947975ef0a697 (patch) | |
| tree | 7a213ee16f9331e928b1c32aa6c521c05519db58 /plugins/check_mysql.c | |
| parent | 1d8128e328f714258b7fec0c62245e1d187e0439 (diff) | |
| download | monitoring-plugins-d19edd4043c498626fe68308005947975ef0a697.tar.gz | |
standardize localization string
standardize unknow arguments
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@969 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_mysql.c')
| -rw-r--r-- | plugins/check_mysql.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index deac37fc..ffd96ed4 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c | |||
| @@ -54,7 +54,7 @@ main (int argc, char **argv) | |||
| 54 | textdomain (PACKAGE); | 54 | textdomain (PACKAGE); |
| 55 | 55 | ||
| 56 | if (process_arguments (argc, argv) != OK) | 56 | if (process_arguments (argc, argv) != OK) |
| 57 | usage (_("Incorrect arguments supplied\n")); | 57 | usage (_("check_mysql: could not parse arguments\n")); |
| 58 | 58 | ||
| 59 | /* initialize mysql */ | 59 | /* initialize mysql */ |
| 60 | mysql_init (&mysql); | 60 | mysql_init (&mysql); |
| @@ -146,8 +146,6 @@ main (int argc, char **argv) | |||
| 146 | 146 | ||
| 147 | 147 | ||
| 148 | 148 | ||
| 149 | |||
| 150 | |||
| 151 | /* process command-line arguments */ | 149 | /* process command-line arguments */ |
| 152 | int | 150 | int |
| 153 | process_arguments (int argc, char **argv) | 151 | process_arguments (int argc, char **argv) |
| @@ -183,7 +181,7 @@ process_arguments (int argc, char **argv) | |||
| 183 | db_host = optarg; | 181 | db_host = optarg; |
| 184 | } | 182 | } |
| 185 | else { | 183 | else { |
| 186 | usage2 (_("Invalid host name"), optarg); | 184 | usage2 (_("Invalid hostname/address"), optarg); |
| 187 | } | 185 | } |
| 188 | break; | 186 | break; |
| 189 | case 'd': /* hostname */ | 187 | case 'd': /* hostname */ |
| @@ -208,7 +206,9 @@ process_arguments (int argc, char **argv) | |||
| 208 | print_help (); | 206 | print_help (); |
| 209 | exit (STATE_OK); | 207 | exit (STATE_OK); |
| 210 | case '?': /* help */ | 208 | case '?': /* help */ |
| 211 | usage (_("Invalid argument\n")); | 209 | printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); |
| 210 | print_usage (); | ||
| 211 | exit (STATE_UNKNOWN); | ||
| 212 | } | 212 | } |
| 213 | } | 213 | } |
| 214 | 214 | ||
| @@ -221,7 +221,7 @@ process_arguments (int argc, char **argv) | |||
| 221 | db_host = argv[c++]; | 221 | db_host = argv[c++]; |
| 222 | } | 222 | } |
| 223 | else { | 223 | else { |
| 224 | usage2 (_("Invalid host name"), optarg); | 224 | usage2 (_("Invalid hostname/address"), optarg); |
| 225 | } | 225 | } |
| 226 | else if (strlen(db_user) == 0) | 226 | else if (strlen(db_user) == 0) |
| 227 | db_user = argv[c++]; | 227 | db_user = argv[c++]; |
| @@ -240,8 +240,6 @@ process_arguments (int argc, char **argv) | |||
| 240 | 240 | ||
| 241 | 241 | ||
| 242 | 242 | ||
| 243 | |||
| 244 | |||
| 245 | int | 243 | int |
| 246 | validate_arguments (void) | 244 | validate_arguments (void) |
| 247 | { | 245 | { |
| @@ -262,9 +260,6 @@ validate_arguments (void) | |||
| 262 | 260 | ||
| 263 | 261 | ||
| 264 | 262 | ||
| 265 | |||
| 266 | |||
| 267 | |||
| 268 | void | 263 | void |
| 269 | print_help (void) | 264 | print_help (void) |
| 270 | { | 265 | { |
| @@ -304,7 +299,6 @@ a server listening on MySQL standard port %d will be checked\n"), MYSQL_PORT); | |||
| 304 | 299 | ||
| 305 | 300 | ||
| 306 | 301 | ||
| 307 | |||
| 308 | void | 302 | void |
| 309 | print_usage (void) | 303 | print_usage (void) |
| 310 | { | 304 | { |
