aboutsummaryrefslogtreecommitdiff
path: root/plugins-root/check_icmp.c
diff options
context:
space:
mode:
authorGravatar Lorenz <12514511+RincewindsHat@users.noreply.github.com> 2022-11-30 00:40:23 +0100
committerGravatar GitHub <noreply@github.com> 2022-11-30 00:40:23 +0100
commit1a923c362d61d7f395f268576d40a54c658f0fc6 (patch)
tree675420db6303a8ac5101c7a5a03822cc0495de7c /plugins-root/check_icmp.c
parent8d288cf0833621aa9097bc08e49b6833616b64a1 (diff)
parenta517c62c1b536c934c92e4ac0f75b49bab927dca (diff)
downloadmonitoring-plugins-1a923c362d61d7f395f268576d40a54c658f0fc6.tar.gz
Merge branch 'master' into by_ssh_random_wait
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r--plugins-root/check_icmp.c16
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)
packets = 5;
}
+ /* support "--help" and "--version" */
+ if(argc == 2) {
+ if(!strcmp(argv[1], "--help"))
+ strcpy(argv[1], "-h");
+ if(!strcmp(argv[1], "--version"))
+ strcpy(argv[1], "-V");
+ }
+
/* Parse protocol arguments first */
for(i = 1; i < argc; i++) {
while((arg = getopt(argc, argv, opts_str)) != EOF) {
@@ -555,14 +563,6 @@ main(int argc, char **argv)
/* Parse extra opts if any */
argv=np_extra_opts(&argc, argv, progname);
- /* support "--help" and "--version" */
- if(argc == 2) {
- if(!strcmp(argv[1], "--help"))
- strcpy(argv[1], "-h");
- if(!strcmp(argv[1], "--version"))
- strcpy(argv[1], "-V");
- }
-
argv = &argv[optind];
while(*argv) {
add_target(*argv);