diff options
author | Igor Murzov <e-mail@date.by> | 2011-11-11 02:46:23 +0300 |
---|---|---|
committer | Igor Murzov <e-mail@date.by> | 2011-11-11 02:46:23 +0300 |
commit | 6f58a699918b7bb22c6355223d7456076b53dc46 (patch) | |
tree | 3e201ba8a0165e80a0cae13d3aa28c5a4df18f78 | |
parent | d0c5761e5bb0911f556ff18d6a72ca82a2d8a490 (diff) | |
download | bash-completion-6f58a699918b7bb22c6355223d7456076b53dc46.tar.gz |
removepkg: Make it possible to complete filenames.
Reported-by: disturbed1
Tested-by: Sergey V <sftp.mtuci@gmail.com>
-rw-r--r-- | completions/removepkg | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/completions/removepkg b/completions/removepkg index 5b3d8273..2fb79869 100644 --- a/completions/removepkg +++ b/completions/removepkg @@ -4,12 +4,17 @@ _removepkg() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then COMPREPLY=( $( compgen -W '-copy -keep -preserve -warn' \ -- "$cur" ) ) return 0 fi + if [[ $cur == */* ]]; then + _filedir + return 0 + fi + local root=${ROOT:-/} COMPREPLY=( $( cd "$root/var/log/packages" 2> /dev/null || return 1 ; \ compgen -f -- "$cur" ) ) |