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_ssh.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_ssh.c')
-rw-r--r-- | plugins/check_ssh.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index ea74fa88..b78443fe 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c | |||
@@ -14,6 +14,8 @@ | |||
14 | along with this program; if not, write to the Free Software | 14 | along with this program; if not, write to the Free Software |
15 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 15 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 | 16 | ||
17 | $Id$ | ||
18 | |||
17 | ******************************************************************************/ | 19 | ******************************************************************************/ |
18 | 20 | ||
19 | #include "common.h" | 21 | #include "common.h" |
@@ -44,6 +46,8 @@ void print_usage (void); | |||
44 | 46 | ||
45 | int ssh_connect (char *haddr, int hport, char *remote_version); | 47 | int ssh_connect (char *haddr, int hport, char *remote_version); |
46 | 48 | ||
49 | |||
50 | |||
47 | int | 51 | int |
48 | main (int argc, char **argv) | 52 | main (int argc, char **argv) |
49 | { | 53 | { |
@@ -54,7 +58,7 @@ main (int argc, char **argv) | |||
54 | textdomain (PACKAGE); | 58 | textdomain (PACKAGE); |
55 | 59 | ||
56 | if (process_arguments (argc, argv) == ERROR) | 60 | if (process_arguments (argc, argv) == ERROR) |
57 | usage (_("Could not parse arguments\n")); | 61 | usage (_("check_ssh: could not parse arguments\n")); |
58 | 62 | ||
59 | /* initialize alarm signal handling */ | 63 | /* initialize alarm signal handling */ |
60 | signal (SIGALRM, socket_timeout_alarm_handler); | 64 | signal (SIGALRM, socket_timeout_alarm_handler); |
@@ -69,6 +73,7 @@ main (int argc, char **argv) | |||
69 | } | 73 | } |
70 | 74 | ||
71 | 75 | ||
76 | |||
72 | /* process command-line arguments */ | 77 | /* process command-line arguments */ |
73 | int | 78 | int |
74 | process_arguments (int argc, char **argv) | 79 | process_arguments (int argc, char **argv) |
@@ -104,8 +109,9 @@ process_arguments (int argc, char **argv) | |||
104 | 109 | ||
105 | switch (c) { | 110 | switch (c) { |
106 | case '?': /* help */ | 111 | case '?': /* help */ |
107 | usage (_("Unknow argument\n")); | 112 | printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); |
108 | break; | 113 | print_usage (); |
114 | exit (STATE_UNKNOWN); | ||
109 | case 'V': /* version */ | 115 | case 'V': /* version */ |
110 | print_revision (progname, revision); | 116 | print_revision (progname, revision); |
111 | exit (STATE_OK); | 117 | exit (STATE_OK); |
@@ -188,6 +194,7 @@ validate_arguments (void) | |||
188 | * | 194 | * |
189 | *-----------------------------------------------------------------------*/ | 195 | *-----------------------------------------------------------------------*/ |
190 | 196 | ||
197 | |||
191 | int | 198 | int |
192 | ssh_connect (char *haddr, int hport, char *remote_version) | 199 | ssh_connect (char *haddr, int hport, char *remote_version) |
193 | { | 200 | { |
@@ -240,6 +247,8 @@ ssh_connect (char *haddr, int hport, char *remote_version) | |||
240 | } | 247 | } |
241 | } | 248 | } |
242 | 249 | ||
250 | |||
251 | |||
243 | void | 252 | void |
244 | print_help (void) | 253 | print_help (void) |
245 | { | 254 | { |
@@ -272,6 +281,8 @@ print_help (void) | |||
272 | printf (_(UT_SUPPORT)); | 281 | printf (_(UT_SUPPORT)); |
273 | } | 282 | } |
274 | 283 | ||
284 | |||
285 | |||
275 | void | 286 | void |
276 | print_usage (void) | 287 | print_usage (void) |
277 | { | 288 | { |