Skip to content

Commit

Permalink
fix(dict): nounset error when host/port not set
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Aug 6, 2023
1 parent 128640e commit 57191e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion completions/dict
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _comp_cmd_dict()
local cur prev words cword comp_args
_comp_initialize -- "$@" || return

local host port db i
local host="" port="" db i

local noargopts='!(-*|*[hpdis]*)'
for ((i = 1; i < cword; i++)); do
Expand Down
4 changes: 4 additions & 0 deletions test/t/test_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ class TestDict:
@pytest.mark.complete("dict -", require_cmd=True)
def test_1(self, completion):
assert completion

@pytest.mark.complete("dict --database ", require_cmd=True)
def test_database(self, completion):
assert completion

0 comments on commit 57191e2

Please sign in to comment.