diff options
author | Kristian Schuster <116557017+KriSchu@users.noreply.github.com> | 2023-02-19 23:49:18 +0100 |
---|---|---|
committer | Kristian Schuster <116557017+KriSchu@users.noreply.github.com> | 2023-02-19 23:49:18 +0100 |
commit | a0d42777217296c0a7bdb1e1be8d8f6de1b24dd7 (patch) | |
tree | 8effe94c57b2f9796ba36090b07551baa8f1e1cb /plugins-root/check_icmp.c | |
parent | ca3d59cd6918c9e2739e783b721d4c1122640fd3 (diff) | |
parent | c07206f2ccc2356aa74bc6813a94c2190017d44e (diff) | |
download | monitoring-plugins-a0d42777217296c0a7bdb1e1be8d8f6de1b24dd7.tar.gz |
Merge remote-tracking branch 'origin/master' into feature_check_disk_add_ignore_missing_option
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r-- | plugins-root/check_icmp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index f8f15351..1f87b75f 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
@@ -451,6 +451,14 @@ main(int argc, char **argv) | |||
451 | packets = 5; | 451 | packets = 5; |
452 | } | 452 | } |
453 | 453 | ||
454 | /* support "--help" and "--version" */ | ||
455 | if(argc == 2) { | ||
456 | if(!strcmp(argv[1], "--help")) | ||
457 | strcpy(argv[1], "-h"); | ||
458 | if(!strcmp(argv[1], "--version")) | ||
459 | strcpy(argv[1], "-V"); | ||
460 | } | ||
461 | |||
454 | /* Parse protocol arguments first */ | 462 | /* Parse protocol arguments first */ |
455 | for(i = 1; i < argc; i++) { | 463 | for(i = 1; i < argc; i++) { |
456 | while((arg = getopt(argc, argv, opts_str)) != EOF) { | 464 | while((arg = getopt(argc, argv, opts_str)) != EOF) { |
@@ -555,14 +563,6 @@ main(int argc, char **argv) | |||
555 | /* Parse extra opts if any */ | 563 | /* Parse extra opts if any */ |
556 | argv=np_extra_opts(&argc, argv, progname); | 564 | argv=np_extra_opts(&argc, argv, progname); |
557 | 565 | ||
558 | /* support "--help" and "--version" */ | ||
559 | if(argc == 2) { | ||
560 | if(!strcmp(argv[1], "--help")) | ||
561 | strcpy(argv[1], "-h"); | ||
562 | if(!strcmp(argv[1], "--version")) | ||
563 | strcpy(argv[1], "-V"); | ||
564 | } | ||
565 | |||
566 | argv = &argv[optind]; | 566 | argv = &argv[optind]; |
567 | while(*argv) { | 567 | while(*argv) { |
568 | add_target(*argv); | 568 | add_target(*argv); |