summaryrefslogtreecommitdiff
path: root/completions/pkgadd
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.eti.br>2017-09-25 23:46:54 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.eti.br>2017-09-25 23:46:54 -0300
commit6d88f1055806932d9291f96847d2b691cccda2cd (patch)
tree0ff79eedaa8a239331256048981deedbd0721965 /completions/pkgadd
parent059a87a5936cfebfd2d71ab8057002cafb2ea051 (diff)
downloadbash-completion-6d88f1055806932d9291f96847d2b691cccda2cd.tar.gz
New upstream version 2.7upstream/2.7
Diffstat (limited to 'completions/pkgadd')
-rw-r--r--completions/pkgadd15
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