[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-380-g9e4605b

Ville Skyttä ville.skytta at iki.fi
Sat Jun 18 12:54:00 UTC 2011


The following commit has been merged in the master branch:
commit 21663725eaf238713f612e9756d531433a7bb1ff
Author: Raphaël Droz <raphael.droz+floss at gmail.com>
Date:   Mon Jun 13 14:33:18 2011 +0200

    handle properly long-options in sitecopy(1).

diff --git a/completions/sitecopy b/completions/sitecopy
index f713985..6c0db01 100644
--- a/completions/sitecopy
+++ b/completions/sitecopy
@@ -7,8 +7,8 @@ have sitecopy || return
 
 _sitecopy()
 {
-    local cur prev words cword
-    _init_completion || return
+    local cur prev words cword split
+    _init_completion -s || return
 
     case $prev in
         --debug|-d)
@@ -31,22 +31,21 @@ _sitecopy()
         --*)
             COMPREPLY=( $( compgen -W "$(_parse_help $1)" -- "$cur" ) )
             [[ $COMPREPLY == *= ]] && compopt -o nospace
+            return 0
             ;;
 
         # only complete long options
         -)
             compopt -o nospace
             COMPREPLY=( -- )
-            ;;
-
-        *)
-            if [ -r ~/.sitecopyrc ]; then
-                COMPREPLY=( $( compgen -W "$($1 -v | \
-			command sed -n '/^Site:/s/Site: //p')" -- "$cur" ) )
-            fi
+            return 0
             ;;
     esac
 
+    if [ -r ~/.sitecopyrc ]; then
+        COMPREPLY=( $( compgen -W "$($1 -v | \
+			command sed -n '/^Site:/s/Site: //p')" -- "$cur" ) )
+    fi
     return 0
 } &&
 complete -F _sitecopy -o default sitecopy

-- 
bash-completion



More information about the Bash-completion-commits mailing list