From 6f58a699918b7bb22c6355223d7456076b53dc46 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Fri, 11 Nov 2011 02:46:23 +0300 Subject: removepkg: Make it possible to complete filenames. Reported-by: disturbed1 Tested-by: Sergey V --- completions/removepkg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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" ) ) -- cgit v1.2.1