Disallow any additional arguments after "shear"

Former-commit-id: 9e523edde7e05634020536cec6e6a3100e298c42 [formerly 2f795b4d03]
Former-commit-id: 847c509f7977ef8aad1582c06be056d1347aee2a
This commit is contained in:
2023-02-20 18:04:37 -05:00
parent 9928a43d6a
commit 764d165ad4
+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