Skip to content

Commit a086857

Browse files
committed
fix(secret-tool): fix empty candidates for "secret-tool search" options
In the completion of `secret-tool', the option names `--all' and `--unlock' are stored as the keys of the associative array `opts' but not as the values. In addition, the test had been wrongly requested not to produce any completion results for "secret-tool search ". Now we have the proper expected result of the test.
1 parent f2bec27 commit a086857

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

completions/secret-tool

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ _secret_tool()
4141
for word in "${words[@]:2}"; do
4242
[[ $word ]] && unset opts["$word"]
4343
done
44-
COMPREPLY=($(compgen -W '${opts[@]}' -- "$cur"))
44+
COMPREPLY=($(compgen -W '${!opts[@]}' -- "$cur"))
4545
;;
4646
esac
4747
} &&

test/t/test_secret_tool.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ def test_modes(self, completion):
99

1010
@pytest.mark.complete("secret-tool search ")
1111
def test_no_complete(self, completion):
12-
assert not completion
12+
assert completion == ["--all", "--unlock"]

0 commit comments

Comments
 (0)