diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-04 22:20:26 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-04 22:20:26 +0200 |
commit | a480681cb7b86adecac69d4969f94e5a6d302190 (patch) | |
tree | 8d0e9e6c948437364c624d9a5bf8171295525f05 | |
parent | b15adb7762b6caaecaa83637abfcf5fdb4802092 (diff) | |
download | monitoring-plugins-a480681cb7b86adecac69d4969f94e5a6d302190.tar.gz |
check_icmp: Support "--help" and "--version"
Let check_icmp provide "--help" and "--version" flags (in addition to
"-h" and "-V"), just as the other plugins do.
-rw-r--r-- | plugins-root/check_icmp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index fe8fc56f..b6804d24 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
@@ -454,6 +454,14 @@ main(int argc, char **argv) | |||
454 | /* Parse extra opts if any */ | 454 | /* Parse extra opts if any */ |
455 | argv=np_extra_opts(&argc, argv, progname); | 455 | argv=np_extra_opts(&argc, argv, progname); |
456 | 456 | ||
457 | /* support "--help" and "--version" */ | ||
458 | if(argc == 2) { | ||
459 | if(!strcmp(argv[1], "--help")) | ||
460 | strcpy(argv[1], "-h"); | ||
461 | if(!strcmp(argv[1], "--version")) | ||
462 | strcpy(argv[1], "-V"); | ||
463 | } | ||
464 | |||
457 | /* parse the arguments */ | 465 | /* parse the arguments */ |
458 | for(i = 1; i < argc; i++) { | 466 | for(i = 1; i < argc; i++) { |
459 | while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) { | 467 | while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) { |