Merge pull request #2014 from RincewindsHat/check_curl_regex_state

Check curl regex state
This commit is contained in:
Lorenz Kästle 2024-10-06 23:24:46 +02:00 committed by GitHub
commit 114e504403
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1775,9 +1775,9 @@ process_arguments (int argc, char **argv)
invert_regex = true;
break;
case STATE_REGEX:
if (!strcmp (optarg, "critical"))
if (!strcasecmp (optarg, "critical"))
state_regex = STATE_CRITICAL;
else if (!strcmp (optarg, "warning"))
else if (!strcasecmp (optarg, "warning"))
state_regex = STATE_WARNING;
else usage2 (_("Invalid state-regex option"), optarg);
break;
@ -2061,8 +2061,8 @@ print_help (void)
printf (" %s\n", "--invert-regex");
printf (" %s\n", _("Return STATE if found, OK if not (STATE is CRITICAL, per default)"));
printf (" %s\n", _("can be changed with --state--regex)"));
printf (" %s\n", "--regex-state=STATE");
printf (" %s\n", _("Return STATE if regex is found, OK if not\n"));
printf (" %s\n", "--state-regex=STATE");
printf (" %s\n", _("Return STATE if regex is found, OK if not. STATE can be one of \"critical\",\"warning\""));
printf (" %s\n", "-a, --authorization=AUTH_PAIR");
printf (" %s\n", _("Username:password on sites with basic authentication"));
printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR");