diff options
Diffstat (limited to 'completions/pkgadd')
-rw-r--r-- | completions/pkgadd | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/completions/pkgadd b/completions/pkgadd index 28098815..009f3a25 100644 --- a/completions/pkgadd +++ b/completions/pkgadd @@ -10,18 +10,18 @@ _pkgadd () # if a device directory was given # we must complete with the package # available in this directory - local device=/var/spool/pkg; + local device=/var/spool/pkg local i=$cword while [[ $((i--)) -gt 0 ]]; do case "${words[$i]}" in -d) - device="${words[$((i+1))]}"; + device="${words[$((i+1))]}" break ;; - esac; - done; + esac + done - case $prev in + case $prev in -d) _filedir pkg _filedir -d @@ -48,7 +48,8 @@ _pkgadd () done pkginst_list="${pkginst_list[@]}" else - pkginst_list=$(strings $(dequote $device) | grep "^PKG=" | sort -u | cut -d= -f2) + pkginst_list=$(strings $(dequote $device) | \ + command grep "^PKG=" | sort -u | cut -d= -f2) fi COMPREPLY=( $(compgen -W "$pkginst_list" -- ${cur}) ) fi @@ -56,4 +57,4 @@ _pkgadd () } && complete -F _pkgadd pkgadd -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh |