Code

still trying to fix #1094326
[nagiosplug.git] / plugins / check_nwstat.c
index b791640f5e1d849efb5a7949586fd69699ed0140..601b25d32178004370c01f0a74d2baa3122f6772 100644 (file)
@@ -121,7 +121,7 @@ main(int argc, char **argv) {
        bindtextdomain (PACKAGE, LOCALEDIR);
        textdomain (PACKAGE);
 
-       if (process_arguments(argc,argv) != TRUE)
+       if (process_arguments(argc,argv) == ERROR)
                usage4 (_("Could not parse arguments"));
 
        /* initialize alarm signal handling */
@@ -760,9 +760,7 @@ int process_arguments(int argc, char **argv) {
                switch (c)
                        {
                        case '?': /* print short usage statement if args not parsable */
-                               printf ("%s: Unknown argument: %s\n\n", progname, optarg);
-                               print_usage();
-                               exit(STATE_UNKNOWN);
+                       usage2 (_("Unknown argument"), optarg);
                        case 'h': /* help */
                                print_help();
                                exit(STATE_OK);
@@ -779,7 +777,7 @@ int process_arguments(int argc, char **argv) {
                                if (is_intnonneg(optarg))
                                        server_port=atoi(optarg);
                                else
-                                       die(STATE_UNKNOWN,_("Server port an integer (seconds)\nType '%s -h' for additional help\n"),progname);
+                                       die(STATE_UNKNOWN,_("Server port an integer\n"));
                                break;
                        case 'v':
                                if (strlen(optarg)<3)
@@ -908,9 +906,8 @@ void print_help(void)
        printf (COPYRIGHT, copyright, email);
 
        printf (_("\
-Usage: %s This plugin attempts to contact the MRTGEXT NLM running\n\
-on a Novell server to gather the requested system information.\n\n"),
-               progname);
+This plugin attempts to contact the MRTGEXT NLM running on a\n\
+Novell server to gather the requested system information.\n\n"));
 
        print_usage();
 
@@ -989,5 +986,5 @@ void print_usage(void)
 {
        printf ("\
 Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
-          [-t timeout].\n", progname);
+                    [-t timeout].\n", progname);
 }