[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.1-3-g94b7e63

Igor Murzov e-mail at date.by
Sat Apr 6 09:37:09 UTC 2013


The following commit has been merged in the master branch:
commit 6cb7f969745dd6b2075dd61244f8e60445a6a3d5
Author: Igor Murzov <e-mail at date.by>
Date:   Sat Apr 6 03:40:32 2013 +0400

    kcov: Add new sort types, complete --replace-src-path arguments

diff --git a/completions/kcov b/completions/kcov
index 86d2d10..3fa06f1 100644
--- a/completions/kcov
+++ b/completions/kcov
@@ -3,7 +3,7 @@
 _kcov()
 {
     local cur prev words cword split
-    _init_completion -s || return
+    _init_completion -s -n : || return
 
     case "$prev" in
         --pid|-p)
@@ -11,25 +11,31 @@ _kcov()
             return
             ;;
         --sort-type|-s)
-            COMPREPLY=( $( compgen -W 'filename percentage lines uncovered' \
-                -- "$cur" ) )
+            COMPREPLY=( $( compgen -W 'filename percent reverse lines
+                uncovered' -- "$cur" ) )
             return
             ;;
         --include-path|--exclude-path)
             _filedir
             return
             ;;
+        --replace-src-path)
+            if [[ "$cur" == ?*:* ]]; then
+                cur="${cur##*:}"
+                _filedir
+            else
+                _filedir
+                compopt -o nospace
+            fi
+            return
+            ;;
         --limits|-l)
-            split=false
             if [[ "$cur" == ?*,* ]]; then
                 prev="${cur%,*}"
                 cur="${cur##*,}"
-                split=true
-            fi
-            COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) )
-            if $split; then
-                COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} )
+                COMPREPLY=( $( compgen -P "$prev," -W "{0..100}" -- "$cur" ) )
             else
+                COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) )
                 compopt -o nospace
             fi
             return

-- 
bash-completion



More information about the Bash-completion-commits mailing list