diff options
author | David Paleino <dapal@debian.org> | 2012-01-08 00:19:18 +0100 |
---|---|---|
committer | David Paleino <dapal@debian.org> | 2012-01-08 00:19:18 +0100 |
commit | c3d398fcc6e400be546c28eb1fc25abfa5816eac (patch) | |
tree | 3266a00f1037eb5522f1f8bf1a73e443ab2c26c4 /completions/removepkg | |
parent | 2c8171c38d87ddef31c92a76547d3fdf773a1337 (diff) | |
download | bash-completion-c3d398fcc6e400be546c28eb1fc25abfa5816eac.tar.gz |
Imported Upstream version 1.99upstream/1.99
Diffstat (limited to 'completions/removepkg')
-rw-r--r-- | completions/removepkg | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/completions/removepkg b/completions/removepkg index 5b3d8273..287952cb 100644 --- a/completions/removepkg +++ b/completions/removepkg @@ -5,13 +5,17 @@ _removepkg() local cur prev words cword _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-copy -keep -preserve -warn' \ - -- "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -W '-copy -keep -preserve -warn' -- "$cur" ) ) + return + fi + + if [[ "$cur" == */* ]]; then + _filedir + return fi local root=${ROOT:-/} - COMPREPLY=( $( cd "$root/var/log/packages" 2> /dev/null || return 1 ; \ + COMPREPLY=( $( cd "$root/var/log/packages" 2> /dev/null || return 1; \ compgen -f -- "$cur" ) ) } && complete -F _removepkg removepkg |