Disallow any additional arguments after "shear"

This commit is contained in:
2023-02-20 18:04:37 -05:00
parent 2fba1262a1
commit 2f795b4d03
+3 -1
View File
@@ -18,7 +18,9 @@ _sshyp_completions() {
local compwords=("${COMP_WORDS[@]:1:$COMP_CWORD-1}")
local compline="${compwords[*]}"
if [ "${#COMP_WORDS[@]}" -gt "3" ] && (! echo "${COMP_WORDS[@]}" | grep -q '/' || echo "${COMP_WORDS[@]}" | grep -q 'shear'); then
if [ "${#COMP_WORDS[@]}" -gt "2" ] && echo "${COMP_WORDS[@]}" | grep -q 'shear'; then
return
elif [ "${#COMP_WORDS[@]}" -gt "3" ] && (! echo "${COMP_WORDS[@]}" | grep -q '/' || echo "${COMP_WORDS[@]}" | grep -q 'shear'); then
return
elif [ "${#COMP_WORDS[@]}" -gt "4" ]; then
return