Skip to content

Commit 377e1b0

Browse files
committed
fix(scp): nounset mode suboption arg completion
1 parent ef2325e commit 377e1b0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

completions/ssh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ _ssh_suboption_check()
215215
# Get prev and cur words without splitting on =
216216
local cureq=$(_get_cword :=) preveq=$(_get_pword :=)
217217
if [[ $cureq == *=* && $preveq == -*o ]]; then
218-
_ssh_suboption $cureq "$1"
218+
_ssh_suboption $cureq "${1-}"
219219
return $?
220220
fi
221221
return 1

test/t/test_scp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,7 @@ def test_live(self, live_pwd, completion):
7777
ConnectTimeout and sleep_after_tab settings.
7878
"""
7979
assert completion == f"{LIVE_HOST}:{live_pwd}/"
80+
81+
@pytest.mark.complete("scp -o Foo=")
82+
def test_option_arg(self, completion):
83+
assert not completion # and no errors either

0 commit comments

Comments
 (0)