From d19edd4043c498626fe68308005947975ef0a697 Mon Sep 17 00:00:00 2001 From: Benoit Mortier Date: Wed, 1 Dec 2004 23:54:51 +0000 Subject: standardize localization string standardize unknow arguments git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@969 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/negate.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'plugins/negate.c') diff --git a/plugins/negate.c b/plugins/negate.c index a71f1b67..9e5cf46f 100644 --- a/plugins/negate.c +++ b/plugins/negate.c @@ -13,6 +13,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + $Id$ @@-
@@ -69,6 +71,8 @@ int validate_arguments (void); void print_help (void); void print_usage (void); + + int main (int argc, char **argv) { @@ -80,7 +84,7 @@ main (int argc, char **argv) textdomain (PACKAGE); if (process_arguments (argc, argv) == ERROR) - usage (_("Could not parse arguments\n")); + usage (_("negate: could not parse arguments\n")); /* Set signal handling and alarm */ if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) @@ -125,8 +129,6 @@ main (int argc, char **argv) else exit (result); } - - /****************************************************************************** @@- @@ -146,6 +148,8 @@ is a only a 'timeout' option. -@@ ******************************************************************************/ + + /* process command-line arguments */ int process_arguments (int argc, char **argv) @@ -169,7 +173,9 @@ process_arguments (int argc, char **argv) switch (c) { case '?': /* help */ - usage3 (_("Unknown argument"), optopt); + printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); + print_usage (); + exit (STATE_UNKNOWN); break; case 'h': /* help */ print_help (); @@ -207,6 +213,8 @@ process_arguments (int argc, char **argv) -@@ ******************************************************************************/ + + int validate_arguments () { @@ -225,9 +233,6 @@ validate_arguments () - - - void print_help (void) { @@ -265,8 +270,6 @@ Otherwise, the output state of the wrapped plugin is unchanged.\n")); - - void print_usage (void) { -- cgit v1.2.3-74-g34f1