summaryrefslogtreecommitdiffstats
path: root/plugins/check_ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_ssh.c')
-rw-r--r--plugins/check_ssh.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index ea74fa8..b78443f 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
45int ssh_connect (char *haddr, int hport, char *remote_version); 47int ssh_connect (char *haddr, int hport, char *remote_version);
46 48
49
50
47int 51int
48main (int argc, char **argv) 52main (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 */
73int 78int
74process_arguments (int argc, char **argv) 79process_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
191int 198int
192ssh_connect (char *haddr, int hport, char *remote_version) 199ssh_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
243void 252void
244print_help (void) 253print_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
275void 286void
276print_usage (void) 287print_usage (void)
277{ 288{