[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.1-6-g9852597

Ville Skyttä ville.skytta at iki.fi
Mon Apr 8 19:56:28 UTC 2013


The following commit has been merged in the master branch:
commit 9852597d8c19567ee1e01c03a297692d9c1cd764
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Apr 8 22:53:37 2013 +0300

    cvs rm: Don't filter existing files with -f (RedHat: #949479).
    
    Thanks-to: Hans de Goede <hdegoede at redhat.com>

diff --git a/completions/cvs b/completions/cvs
index 7127755..f470a1b 100644
--- a/completions/cvs
+++ b/completions/cvs
@@ -51,7 +51,7 @@ _cvs()
     _init_completion -n : || return
 
     local count mode i cvsroot cvsroots pwd
-    local -a flags miss files entries changed newremoved
+    local -a flags files entries changed newremoved
 
     count=0
     for i in "${words[@]}"; do
@@ -334,11 +334,13 @@ _cvs()
         remove)
             if [[ "$cur" != -* ]]; then
                 _cvs_entries
-                # find out what files are missing
-                for i in "${entries[@]}"; do
-                    [[ ! -r $i ]] && miss+=( $i )
-                done
-                COMPREPLY=( $( compgen -W '${miss[@]:-}' -- "$cur" ) )
+                if [[ "$prev" != -f ]]; then
+                    # find out what files are missing
+                    for i in ${!entries[@]}; do
+                        [[ -r "${entries[i]}" ]] && unset entries[i]
+                    done
+                fi
+                COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) )
             else
                 _cvs_command_options "$1" $mode
             fi

-- 
bash-completion



More information about the Bash-completion-commits mailing list