From 2f795b4d0325b12666e5e0cfe77df4107a9bf3d4 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 20 Feb 2023 18:04:37 -0500 Subject: [PATCH] Disallow any additional arguments after "shear" --- extra/sshyp-completion.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extra/sshyp-completion.bash b/extra/sshyp-completion.bash index bc66be1..aef9107 100755 --- a/extra/sshyp-completion.bash +++ b/extra/sshyp-completion.bash @@ -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