summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2013-06-29 10:28:01 +0200
committerAndreas Baumann <abaumann@yahoo.com>2013-06-29 10:28:01 +0200
commit7b1e294e8d6b98c69fb7e7574e2093fbfe5d195f (patch)
tree851f4533334afc8e513e21d0b44ca11f9d45d90c
parent20b6bb141bb38ae1a30f85a483ae79f7d6666300 (diff)
downloadnagios-plugin-curl-7b1e294e8d6b98c69fb7e7574e2093fbfe5d195f.tar.gz
nagios-plugin-curl-7b1e294e8d6b98c69fb7e7574e2093fbfe5d195f.tar.bz2
fixed packaging for Fedora 18
-rw-r--r--redhat/nagios-plugin-curl.spec6
-rw-r--r--src/cmdline.c53
-rw-r--r--src/cmdline.h4
3 files changed, 38 insertions, 25 deletions
diff --git a/redhat/nagios-plugin-curl.spec b/redhat/nagios-plugin-curl.spec
index dd02acf..887ab56 100644
--- a/redhat/nagios-plugin-curl.spec
+++ b/redhat/nagios-plugin-curl.spec
@@ -54,6 +54,12 @@
%define fc17 1
%define fedora 1
%endif
+%define fc18 0
+%if 0%{?fedora_version} == 18
+%define dist fc18
+%define fc18 1
+%define fedora 1
+%endif
%define suse 0
%if 0%{?suse_version} == 1140
diff --git a/src/cmdline.c b/src/cmdline.c
index 87fe6ee..2c4734f 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -1,5 +1,5 @@
/*
- File autogenerated by gengetopt version 2.22.5
+ File autogenerated by gengetopt version 2.22.6
generated with the following command:
gengetopt --unamed-opts --include-getopt --conf-parser -i check_curl.ggo
@@ -28,31 +28,33 @@ const char *gengetopt_args_info_purpose = "Nagios plugin using libcurl and libpc
const char *gengetopt_args_info_usage = "Usage: [options] | --config-file <configuration file with options>";
+const char *gengetopt_args_info_versiontext = "";
+
const char *gengetopt_args_info_description = "";
const char *gengetopt_args_info_help[] = {
" -h, --help Print help and exit",
" -V, --version Print version and exit",
" --config-file=filename The optional configuration file",
- " -v, --verbose Show details for command-line debugging (Nagios \n may truncate output)",
- " -t, --timeout=INTEGER Seconds before connection times out (default: \n 10)",
- " -c, --critical=INTEGER Response time to result in critical status \n (seconds)",
+ " -v, --verbose Show details for command-line debugging (Nagios\n may truncate output)",
+ " -t, --timeout=INTEGER Seconds before connection times out (default:\n 10)",
+ " -c, --critical=INTEGER Response time to result in critical status\n (seconds)",
" -w, --warning=INTEGER Response time to result in warning",
- " -H, --host=host The host name in a HTTP 1.1 request (virtual \n host)",
+ " -H, --host=host The host name in a HTTP 1.1 request (virtual\n host)",
" -I, --ip=host/IP The host/IP to check",
" -p, --port=INTEGER Port number (default: 80)",
" -u, --url=PATH URL to GET or POST (default: /)",
- " -f, --onredirect=STRING How to handle redirected pages (possible \n values=\"ok\", \"warning\", \"critical\", \n \"follow\")",
- " -a, --authorization=Username:Password\n Username:password on sites with basic \n authentication",
+ " -f, --onredirect=STRING How to handle redirected pages (possible\n values=\"ok\", \"warning\", \"critical\",\n \"follow\")",
+ " -a, --authorization=Username:Password\n Username:password on sites with basic\n authentication",
" -s, --string=STRING String to expect in the content",
" -S, --ssl Connect via SSL. Port defaults to 443",
- " -A, --useragent=STRING String to be sent in http header as \"User \n Agent\"",
- " --no-verify-peer Allow connections to SSL sites without certs \n (SSL)",
- " --no-verify-host Don't verify that the host and the certificate \n host match (SSL)",
+ " -A, --useragent=STRING String to be sent in http header as \"User\n Agent\"",
+ " --no-verify-peer Allow connections to SSL sites without certs\n (SSL)",
+ " --no-verify-host Don't verify that the host and the certificate\n host match (SSL)",
" --cacert=file CA certificate to verify peer against (SSL)",
" -E, --cert=file Client certificate file and password (SSL)",
" --key=key Private key file name (SSL)",
- " --protocol=protocol The protocol to use (http, ftp) (possible \n values=\"http\", \"ftp\" default=`http')",
+ " --protocol=protocol The protocol to use (http, ftp) (possible\n values=\"http\", \"ftp\" default=`http')",
0
};
@@ -204,6 +206,9 @@ cmdline_parser_print_version (void)
printf ("%s %s\n",
(strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
CMDLINE_PARSER_VERSION);
+
+ if (strlen(gengetopt_args_info_versiontext) > 0)
+ printf("\n%s\n", gengetopt_args_info_versiontext);
}
static void print_help_common(void) {
@@ -486,7 +491,7 @@ check_multiple_option_occurrences(const char *prog_name, unsigned int option_giv
int
check_multiple_option_occurrences(const char *prog_name, unsigned int option_given, unsigned int min, unsigned int max, const char *option_desc)
{
- int error = 0;
+ int error_occurred = 0;
if (option_given && (min > 0 || max > 0))
{
@@ -499,7 +504,7 @@ check_multiple_option_occurrences(const char *prog_name, unsigned int option_giv
{
fprintf (stderr, "%s: %s option occurrences must be %d\n",
prog_name, option_desc, min);
- error = 1;
+ error_occurred = 1;
}
}
else if (option_given < (unsigned int) min
@@ -508,7 +513,7 @@ check_multiple_option_occurrences(const char *prog_name, unsigned int option_giv
/* range occurrences */
fprintf (stderr, "%s: %s option occurrences must be between %d and %d\n",
prog_name, option_desc, min, max);
- error = 1;
+ error_occurred = 1;
}
}
else if (min > 0)
@@ -518,7 +523,7 @@ check_multiple_option_occurrences(const char *prog_name, unsigned int option_giv
{
fprintf (stderr, "%s: %s option occurrences must be at least %d\n",
prog_name, option_desc, min);
- error = 1;
+ error_occurred = 1;
}
}
else if (max > 0)
@@ -528,12 +533,12 @@ check_multiple_option_occurrences(const char *prog_name, unsigned int option_giv
{
fprintf (stderr, "%s: %s option occurrences must be at most %d\n",
prog_name, option_desc, max);
- error = 1;
+ error_occurred = 1;
}
}
}
- return error;
+ return error_occurred;
}
int
cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
@@ -600,23 +605,23 @@ cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog
int
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
{
- int error = 0;
+ int error_occurred = 0;
FIX_UNUSED (additional_error);
/* checks for required options */
if (check_multiple_option_occurrences(prog_name, args_info->verbose_given, args_info->verbose_min, args_info->verbose_max, "'--verbose' ('-v')"))
- error = 1;
+ error_occurred = 1;
if (! args_info->ip_given)
{
fprintf (stderr, "%s: '--ip' ('-I') option required%s\n", prog_name, (additional_error ? additional_error : ""));
- error = 1;
+ error_occurred = 1;
}
/* checks for dependences among options */
- return error;
+ return error_occurred;
}
/*
@@ -1346,7 +1351,7 @@ cmdline_parser_internal (
{
int c; /* Character of the parsed option. */
- int error = 0;
+ int error_occurred = 0;
struct gengetopt_args_info local_args_info;
int override;
@@ -1698,12 +1703,12 @@ cmdline_parser_internal (
if (check_required)
{
- error += cmdline_parser_required2 (args_info, argv[0], additional_error);
+ error_occurred += cmdline_parser_required2 (args_info, argv[0], additional_error);
}
cmdline_parser_release (&local_args_info);
- if ( error )
+ if ( error_occurred )
return (EXIT_FAILURE);
if (optind < argc)
diff --git a/src/cmdline.h b/src/cmdline.h
index 7277d5f..d1d63cd 100644
--- a/src/cmdline.h
+++ b/src/cmdline.h
@@ -1,6 +1,6 @@
/** @file cmdline.h
* @brief The header file for the command line option parser
- * generated by GNU Gengetopt version 2.22.5
+ * generated by GNU Gengetopt version 2.22.6
* http://www.gnu.org/software/gengetopt.
* DO NOT modify this file, since it can be overwritten
* @author GNU Gengetopt by Lorenzo Bettini */
@@ -135,6 +135,8 @@ struct cmdline_parser_params
extern const char *gengetopt_args_info_purpose;
/** @brief the usage string of the program */
extern const char *gengetopt_args_info_usage;
+/** @brief the description string of the program */
+extern const char *gengetopt_args_info_description;
/** @brief all the lines making the help output */
extern const char *gengetopt_args_info_help[];