@@ -955,6 +955,10 @@ if [[ $BASH_VERSION_MAJOR -eq 5 && $BASH_VERSION_MINOR -ge 1 ]]; then
955955 function __case_insensitive_compare {
956956 [[ ${1@ L} == " ${2@ L} " ]] || return $?
957957 }
958+ function __case_insensitive_compare_contains {
959+ # trunk-ignore(shellcheck/SC2053)
960+ [[ ${1@ L} == * " ${2@ L} " * ]] || return $?
961+ }
958962 function __case_insensitive_compare_pattern {
959963 # trunk-ignore(shellcheck/SC2053)
960964 [[ ${1@ L} =~ ${2@ L} ]] || return $?
@@ -1001,6 +1005,9 @@ else
10011005 function __case_insensitive_compare {
10021006 [[ ${1,,} == " ${2,,} " ]] || return $?
10031007 }
1008+ function __case_insensitive_compare_contains {
1009+ [[ ${1,,} == * " ${2,,} " * ]] || return $?
1010+ }
10041011 function __case_insensitive_compare_pattern {
10051012 # trunk-ignore(shellcheck/SC2053)
10061013 [[ ${1,,} =~ ${2,,} ]] || return $?
@@ -1056,6 +1063,10 @@ else
10561063 shopt -s nocasematch
10571064 [[ $1 == " $2 " ]] || return $?
10581065 )
1066+ function __case_insensitive_compare_contains () (
1067+ shopt -s nocasematch
1068+ [[ $1 == * " $2 " * ]] || return $?
1069+ )
10591070 function __case_insensitive_compare_pattern () (
10601071 shopt -s nocasematch
10611072 # trunk-ignore(shellcheck/SC2053)
0 commit comments