[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-390-gdfaf85f

Ville Skyttä ville.skytta at iki.fi
Tue Jun 28 21:30:35 UTC 2011


The following commit has been merged in the master branch:
commit dfaf85f19774aec782c3eeeb9be68eef61eea2ed
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Jun 29 00:30:08 2011 +0300

    pinfo: New completion, reusing the one for info.

diff --git a/completions/info b/completions/info
index 58f359c..432e57e 100644
--- a/completions/info
+++ b/completions/info
@@ -1,6 +1,6 @@
 # bash completion for info
 
-have info || return
+have info || have pinfo || return
 
 _info()
 {
@@ -16,14 +16,20 @@ _info()
     fi
 
     case $prev in
-        -k|--apropos|--index-search|-n|--node)
+        -k|--apropos|--index-search|-n|--node|-h|--help|-v|--version)
             return
             ;;
-        -d|--directory)
+        -d)
+            if [[ ${1##*/} == info ]]; then
+                _filedir -d
+                return
+            fi
+            ;;
+        --directory)
             _filedir -d
             return
             ;;
-        --dribble|-f|--file|-o|--output|--restore)
+        --dribble|-f|--file|-o|--output|--restore|-r|--raw-filename|--rcfile)
             _filedir
             return
             ;;
@@ -68,7 +74,7 @@ _info()
 
     return 0
 } &&
-complete -F _info info
+complete -F _info info pinfo
 
 # Local variables:
 # mode: shell-script
diff --git a/test/completion/pinfo.exp b/test/completion/pinfo.exp
new file mode 100644
index 0000000..3e93756
--- /dev/null
+++ b/test/completion/pinfo.exp
@@ -0,0 +1 @@
+assert_source_completions pinfo
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/pinfo.exp
similarity index 80%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/pinfo.exp
index 77cd07f..3af4404 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/pinfo.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "a2ps "
+assert_complete_any "pinfo "
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list