diff options
Diffstat (limited to 'completions/removepkg')
-rw-r--r-- | completions/removepkg | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/completions/removepkg b/completions/removepkg index 77f414f6..a56beb07 100644 --- a/completions/removepkg +++ b/completions/removepkg @@ -4,20 +4,22 @@ _removepkg() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '-copy -keep -preserve -warn' -- "$cur") ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-copy -keep -preserve -warn' -- "$cur")) return fi - if [[ "$cur" == */* ]]; then + if [[ $cur == */* ]]; then _filedir return fi local root=${ROOT:-/} - COMPREPLY=( $(cd "$root/var/log/packages" 2>/dev/null || return 1; \ - compgen -f -- "$cur") ) + COMPREPLY=($( + cd "$root/var/log/packages" 2>/dev/null || return 1 + compgen -f -- "$cur" + )) } && -complete -F _removepkg removepkg + complete -F _removepkg removepkg # ex: filetype=sh |