return 0
fi
local IFS=.
+ # Ignore the shellcheck warning, we want splitting to happen based on IFS.
+ # shellcheck disable=SC2206
local i ver1=($1) ver2=($2)
# fill empty fields in ver1 with zeros
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
return 0
}
+# Shellcheck flags the following functions that are unused as "unreachable",
+# ignore that.
+
+# shellcheck disable=SC2317
verlte() {
- vercomp "$1" "$2"; local res="$?"
+ vercomp "$1" "$2"
+ local res="$?"
[ "$res" -eq "0" ] || [ "$res" -eq "2" ]
}
+# shellcheck disable=SC2317
verlt() {
vercomp "$1" "$2"; local res="$?"
[ "$res" -eq "2" ]
}
+# shellcheck disable=SC2317
vergte() {
vercomp "$1" "$2"; local res="$?"
[ "$res" -eq "0" ] || [ "$res" -eq "1" ]
}
+# shellcheck disable=SC2317
vergt() {
vercomp "$1" "$2"; local res="$?"
[ "$res" -eq "1" ]
}
+# shellcheck disable=SC2317
verne() {
vercomp "$1" "$2"; local res="$?"
[ "$res" -ne "0" ]