diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.eti.br> | 2017-09-25 23:46:54 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.eti.br> | 2017-09-25 23:46:54 -0300 |
commit | 6d88f1055806932d9291f96847d2b691cccda2cd (patch) | |
tree | 0ff79eedaa8a239331256048981deedbd0721965 /completions/pkgadd | |
parent | 059a87a5936cfebfd2d71ab8057002cafb2ea051 (diff) | |
download | bash-completion-6d88f1055806932d9291f96847d2b691cccda2cd.tar.gz |
New upstream version 2.7upstream/2.7
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 |