Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dpkg: Fix dpkg -i home dir completion
  • Loading branch information
scop committed Jun 25, 2017
1 parent fc8c976 commit dd8c53b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions completions/dpkg
Expand Up @@ -39,8 +39,6 @@ _dpkg()
local cur prev words cword split
_init_completion -s || return

_expand || return

local i=$cword

# find the last option flag
Expand Down
8 changes: 8 additions & 0 deletions test/lib/completions/dpkg.exp
Expand Up @@ -21,8 +21,16 @@ sync_after_int
if {[assert_exec {dpkg --get-selections | command grep \[\[:space:\]\]install$ | cut -f1} packages]} {
assert_complete $packages "dpkg -L "
}
sync_after_int


set test "dpkg -i ~part should complete to ~full/ if home dir exists"
# https://bugs.debian.org/864691
# Create list of users, having existing home dir
assert_bash_exec {for u in $(compgen -u); do \
eval test -d ~$u && echo $u; unset u; done} {} /@ users
find_unique_completion_pair $users part full
assert_complete "~$full/" "dpkg -i ~$part" $test -nospace
sync_after_int


Expand Down

0 comments on commit dd8c53b

Please sign in to comment.