mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-03-24 11:23:12 -04:00
Remove getopt_long checks
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@396 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
d7ba5ec38b
commit
7283211f00
32 changed files with 27 additions and 258 deletions
|
|
@ -174,7 +174,6 @@ process_arguments (int argc, char **argv)
|
|||
char *p1, *p2;
|
||||
size_t len;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"version", no_argument, 0, 'V'},
|
||||
|
|
@ -195,7 +194,6 @@ process_arguments (int argc, char **argv)
|
|||
{"use-ipv6", no_argument, 0, '6'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -205,13 +203,8 @@ process_arguments (int argc, char **argv)
|
|||
strcpy (argv[c], "-t");
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options,
|
||||
c = getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -156,17 +155,12 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "hVvt:l:H:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hVvt:l:H:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"warning", required_argument, 0, 'w'},
|
||||
|
|
@ -235,7 +234,6 @@ process_arguments (int argc, char **argv)
|
|||
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -245,12 +243,7 @@ process_arguments (int argc, char **argv)
|
|||
strcpy (argv[c], "-t");
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+?Vqhvet:c:w:p:x:m");
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -262,7 +262,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int opt_index = 0;
|
||||
static struct option long_opts[] = {
|
||||
{"help", no_argument, 0, 'h'},
|
||||
|
|
@ -275,7 +274,6 @@ process_arguments (int argc, char **argv)
|
|||
{"expected-address", required_argument, 0, 'a'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -285,11 +283,7 @@ process_arguments (int argc, char **argv)
|
|||
strcpy (argv[c], "-t");
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "hVvt:H:s:r:a:", long_opts, &opt_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hVvt:H:s:r:a:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@ process_arguments (int argc, char **argv)
|
|||
int c;
|
||||
char *rv[2];
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -215,7 +214,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
rv[PL] = NULL;
|
||||
rv[RTA] = NULL;
|
||||
|
|
@ -231,12 +229,7 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "+hVvH:c:w:b:n:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+hVvH:c:w:b:n:");
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "+hVvH:c:w:b:n:", long_options, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -390,7 +390,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -402,18 +401,13 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "+hVH:C:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+?hVH:C:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -296,7 +296,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c = 1;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
STD_LONG_OPTS,
|
||||
|
|
@ -317,7 +316,6 @@ process_arguments (int argc, char **argv)
|
|||
{"min", required_argument, 0, 'm'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -335,14 +333,8 @@ process_arguments (int argc, char **argv)
|
|||
strcpy (argv[c], "-n");
|
||||
}
|
||||
|
||||
#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:"
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, OPTCHARS);
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", long_options, &option_index);
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
||||
|
|
@ -1068,12 +1060,7 @@ void
|
|||
print_usage (void)
|
||||
{
|
||||
printf ("Usage:\n" " %s %s\n"
|
||||
#ifdef HAVE_GETOPT_H
|
||||
" %s (-h | --help) for detailed help\n"
|
||||
" %s (-V | --version) for version information\n",
|
||||
#else
|
||||
" %s -h for detailed help\n"
|
||||
" %s -V for version information\n",
|
||||
#endif
|
||||
progname, OPTIONS, progname, progname);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
#include <unistd.h>
|
||||
#include <linux/hdreg.h>
|
||||
#include <linux/types.h>
|
||||
#include <getopt.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define NR_ATTRIBUTES 30
|
||||
|
|
@ -342,7 +341,6 @@ main (int argc, char *argv[])
|
|||
int o, longindex;
|
||||
int retval = 0;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
const struct option longopts[] = {
|
||||
{"device", required_argument, 0, 'd'},
|
||||
{"immediate", no_argument, 0, 'i'},
|
||||
|
|
@ -354,16 +352,10 @@ main (int argc, char *argv[])
|
|||
{"version", no_argument, 0, 'V'}, {0, 0, 0, 0}
|
||||
};
|
||||
|
||||
#endif /* */
|
||||
while (1) {
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
|
||||
|
||||
#else /* */
|
||||
o = getopt (argc, argv, "+d:iq10nhV");
|
||||
|
||||
#endif /* */
|
||||
if (o == -1 || o == EOF)
|
||||
break;
|
||||
switch (o) {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
/* initialize the long option struct */
|
||||
static struct option longopts[] = {
|
||||
|
|
@ -147,7 +146,6 @@ process_arguments (int argc, char **argv)
|
|||
{"crit", required_argument, 0, 'c'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -158,11 +156,7 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+?hVt:c:w:H:b:p:a:D:P:");
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c = 0;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"warning", required_argument, 0, 'w'},
|
||||
|
|
@ -164,19 +163,13 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#define OPTCHARS "Vhc:w:"
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, OPTCHARS);
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "Vhc:w:", long_options, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -214,7 +214,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"logfile", required_argument, 0, 'F'},
|
||||
|
|
@ -230,7 +229,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -245,13 +243,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", long_options,
|
||||
c = getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hVF:e:a:v:c:w:l:u:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
@ -370,12 +363,7 @@ void
|
|||
print_usage (void)
|
||||
{
|
||||
printf ("Usage:\n" " %s %s\n"
|
||||
#ifdef HAVE_GETOPT_H
|
||||
" %s (-h | --help) for detailed help\n"
|
||||
" %s (-V | --version) for version information\n",
|
||||
#else
|
||||
" %s -h for detailed help\n"
|
||||
" %s -V for version information\n",
|
||||
#endif
|
||||
progname, OPTIONS, progname, progname);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,7 +231,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option longopts[] = {
|
||||
{"logfile", required_argument, 0, 'F'},
|
||||
|
|
@ -245,7 +244,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -260,11 +258,7 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hVF:e:a:c:w:");
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -139,18 +138,12 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 1)
|
||||
return ERROR;
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "hVP:p:u:d:H:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hVP:p:u:d:H:");
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "hVP:p:u:d:H:", long_options, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -144,7 +144,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"filename", required_argument, 0, 'F'},
|
||||
|
|
@ -154,7 +153,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -172,11 +170,7 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "+hVF:C:e:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+hVF:C:e:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -387,7 +387,6 @@ int main(int argc, char **argv){
|
|||
int process_arguments(int argc, char **argv){
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] =
|
||||
{
|
||||
|
|
@ -401,7 +400,6 @@ int process_arguments(int argc, char **argv){
|
|||
{"help", no_argument, 0,'h'},
|
||||
{0,0,0,0}
|
||||
};
|
||||
#endif
|
||||
|
||||
/* no options were supplied */
|
||||
if(argc<2) return ERROR;
|
||||
|
|
@ -424,11 +422,7 @@ int process_arguments(int argc, char **argv){
|
|||
}
|
||||
|
||||
while (1){
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",long_options,&option_index);
|
||||
#else
|
||||
c = getopt(argc,argv,"+hVH:t:c:w:p:v:l:s:d:");
|
||||
#endif
|
||||
|
||||
if (c==-1||c==EOF||c==1)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -622,7 +622,6 @@ int main(int argc, char **argv){
|
|||
int process_arguments(int argc, char **argv){
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] =
|
||||
{
|
||||
|
|
@ -637,7 +636,6 @@ int process_arguments(int argc, char **argv){
|
|||
{"help", no_argument, 0,'h'},
|
||||
{0,0,0,0}
|
||||
};
|
||||
#endif
|
||||
|
||||
/* no options were supplied */
|
||||
if(argc<2) return ERROR;
|
||||
|
|
@ -660,11 +658,7 @@ int process_arguments(int argc, char **argv){
|
|||
}
|
||||
|
||||
while (1){
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long(argc,argv,"+hoVH:t:c:w:p:v:",long_options,&option_index);
|
||||
#else
|
||||
c = getopt(argc,argv,"+hoVH:t:c:w:p:v:");
|
||||
#endif
|
||||
|
||||
if (c==-1||c==EOF||c==1)
|
||||
break;
|
||||
|
|
@ -797,13 +791,8 @@ void print_usage(void)
|
|||
printf
|
||||
("Usage:\n"
|
||||
" %s %s\n"
|
||||
#ifdef HAVE_GETOPT_H
|
||||
" %s (-h | --help) for detailed help\n"
|
||||
" %s (-V | --version) for version information\n",
|
||||
#else
|
||||
" %s -h for detailed help\n"
|
||||
" %s -V for version information\n",
|
||||
#endif
|
||||
progname, OPTIONS, progname, progname);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"port", required_argument, 0, 'p'},
|
||||
|
|
@ -330,7 +329,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
/* no options were supplied */
|
||||
if (argc < 2)
|
||||
|
|
@ -354,13 +352,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "+hVH:t:c:w:p:v:", long_options,
|
||||
c = getopt_long (argc, argv, "+hVH:t:c:w:p:v:", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+hVH:t:c:w:p:v:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -246,7 +246,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"help", no_argument, 0, 'h'},
|
||||
|
|
@ -262,15 +261,11 @@ process_arguments (int argc, char **argv)
|
|||
{"database", required_argument, 0, 'd'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "hVt:c:w:H:P:d:l:p:a:",
|
||||
long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hVt:c:w:H:P:d:l:p:a:");
|
||||
#endif
|
||||
|
||||
if (c == EOF)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,6 @@ process_arguments (int argc, char **argv)
|
|||
int c = 1;
|
||||
char *ptr;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
STD_LONG_OPTS,
|
||||
|
|
@ -171,9 +170,6 @@ process_arguments (int argc, char **argv)
|
|||
{"link", no_argument, 0, 'L'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#define OPTCHARS "VvhnLt:c:w:H:p:"
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -186,11 +182,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, OPTCHARS);
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "VvhnLt:c:w:H:p:", long_options, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
||||
|
|
@ -507,13 +500,8 @@ void
|
|||
print_usage (void)
|
||||
{
|
||||
printf ("Usage:\n" " %s %s\n"
|
||||
#ifdef HAVE_GETOPT_H
|
||||
" %s (-h | --help) for detailed help\n"
|
||||
" %s (-V | --version) for version information\n",
|
||||
#else
|
||||
" %s -h for detailed help\n"
|
||||
" %s -V for version information\n",
|
||||
#endif
|
||||
progname, OPTIONS, progname, progname);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -268,7 +268,6 @@ process_arguments (int argc, char **argv)
|
|||
int c = 1;
|
||||
char *user;
|
||||
struct passwd *pw;
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"warning", required_argument, 0, 'w'},
|
||||
|
|
@ -283,18 +282,14 @@ process_arguments (int argc, char **argv)
|
|||
{"verbose", no_argument, 0, 'v'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
for (c = 1; c < argc; c++)
|
||||
if (strcmp ("-to", argv[c]) == 0)
|
||||
strcpy (argv[c], "-t");
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "Vvht:c:w:p:s:u:C:a:");
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:", long_options, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -208,7 +208,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -224,7 +223,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -251,13 +249,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", long_options,
|
||||
c = getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+hVvH:P:F:u:p:t:r:e:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
|
@ -340,12 +333,7 @@ void
|
|||
print_usage (void)
|
||||
{
|
||||
printf ("Usage:\n" " %s %s\n"
|
||||
#ifdef HAVE_GETOPT_H
|
||||
" %s (-h | --help) for detailed help\n"
|
||||
" %s (-V | --version) for version information\n",
|
||||
#else
|
||||
" %s -h for detailed help\n"
|
||||
" %s -V for version information\n",
|
||||
#endif
|
||||
progname, OPTIONS, progname, progname);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,7 +274,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -290,7 +289,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -305,13 +303,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "+hVI:H:e:u:p:w:c:t:", long_options,
|
||||
c = getopt_long (argc, argv, "+hVI:H:e:u:p:w:c:t:", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+?hVI:H:e:u:p:w:c:t");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -192,7 +192,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -206,7 +205,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -221,13 +219,9 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:", long_options,
|
||||
c = getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+?hVvt:p:f:e:c:w:H:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -422,7 +422,6 @@ process_arguments (int argc, char **argv)
|
|||
int c = 1;
|
||||
int j = 0, jj = 0, ii = 0;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
STD_LONG_OPTS,
|
||||
|
|
@ -447,7 +446,6 @@ process_arguments (int argc, char **argv)
|
|||
{"privpasswd", required_argument, 0, 'X'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -463,13 +461,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:",
|
||||
c = getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:",
|
||||
long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ process_arguments (int argc, char **argv)
|
|||
int c;
|
||||
char *tmp = NULL;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"version", no_argument, 0, 'V'},
|
||||
|
|
@ -74,7 +73,6 @@ process_arguments (int argc, char **argv)
|
|||
{"host", required_argument, 0, 'H'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -84,11 +82,8 @@ process_arguments (int argc, char **argv)
|
|||
strcpy (argv[c], "-t");
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+Vhvt:H:p:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,6 @@ process_arguments (int argc, char **argv)
|
|||
int wc = 0; /* warning counter */
|
||||
int cc = 0; /* critical counter */
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"warning", required_argument, 0, 'w'},
|
||||
|
|
@ -209,17 +208,12 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "+?Vvhac:w:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+?Vvhac:w:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -334,7 +334,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -354,7 +353,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
usage ("No arguments found\n");
|
||||
|
|
@ -377,13 +375,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S", long_options,
|
||||
c = getopt_long (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -158,7 +158,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -172,7 +171,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
usage ("\n");
|
||||
|
|
@ -191,13 +189,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "hVH:w:c:W:C:p:t:", long_options,
|
||||
c = getopt_long (argc, argv, "hVH:w:c:W:C:p:t:", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hVH:w:c:W:C:p:t:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -140,7 +139,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
usage ("\n");
|
||||
|
|
@ -155,11 +153,7 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "+hVvH:e:s:c:w:t:p:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+hVvH:e:s:c:w:t:p:");
|
||||
#endif
|
||||
c = getopt_long (argc, argv, "+hVvH:e:s:c:w:t:p:", long_options, &option_index);
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -434,7 +434,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"hostname", required_argument, 0, 'H'},
|
||||
|
|
@ -448,7 +447,6 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
|
@ -463,13 +461,8 @@ process_arguments (int argc, char **argv)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c =
|
||||
getopt_long (argc, argv, "hVH:u:p:v:c:w:t:", long_options,
|
||||
c = getopt_long (argc, argv, "hVH:u:p:v:c:w:t:", long_options,
|
||||
&option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "hVH:u:p:v:c:w:t:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"critical", required_argument, 0, 'c'},
|
||||
|
|
@ -145,17 +144,12 @@ process_arguments (int argc, char **argv)
|
|||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
usage ("\n");
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "+hVvc:w:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+hVvc:w:");
|
||||
#endif
|
||||
|
||||
if (c == -1 || c == EOF || c == 1)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"help", no_argument, 0, 'h'},
|
||||
|
|
@ -150,17 +149,13 @@ process_arguments (int argc, char **argv)
|
|||
{"command", required_argument, 0, 'C'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return ERROR;
|
||||
|
||||
while (1) {
|
||||
#ifdef HAVE_GETOPT_H
|
||||
c = getopt_long (argc, argv, "+hVc:w:C:", long_options, &option_index);
|
||||
#else
|
||||
c = getopt (argc, argv, "+hVc:w:C:");
|
||||
#endif
|
||||
|
||||
if (c == EOF)
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue