File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,10 @@ _dpkg()
87
87
$split && return
88
88
89
89
COMPREPLY=($( compgen -W ' $(_parse_help "$1")' -- " $cur " ) )
90
+ for i in ${! COMPREPLY[*]} ; do
91
+ # remove ones ending with a dash (known parse issue, hard to fix)
92
+ [[ ${COMPREPLY[i]} != * - ]] || unset ' COMPREPLY[i]'
93
+ done
90
94
[[ ${COMPREPLY-} == * = ]] && compopt -o nospace
91
95
} &&
92
96
complete -F _dpkg dpkg dpkg-deb dpkg-query
Original file line number Diff line number Diff line change @@ -17,3 +17,7 @@ def test_3(self, completion):
17
17
@pytest .mark .complete ("dpkg -i dpkg/" )
18
18
def test_i_deb (self , completion ):
19
19
assert completion == "bash-completion-test-subject.deb"
20
+
21
+ @pytest .mark .complete ("dpkg -" )
22
+ def test_no_trailing_dash_options (self , completion ):
23
+ assert not any (x .endswith ("-" ) for x in completion )
You can’t perform that action at this time.
0 commit comments