[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-66-ga958ccd

Ville Skyttä ville.skytta at iki.fi
Fri Nov 25 18:03:43 UTC 2011


The following commit has been merged in the master branch:
commit a958ccde50b9fa4feee7432adc134fcfd4fbad83
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Nov 25 20:00:23 2011 +0200

    perldoc: Add some option arg completions, use _parse_help.

diff --git a/completions/perl b/completions/perl
index a67c769..8b29637 100644
--- a/completions/perl
+++ b/completions/perl
@@ -99,16 +99,22 @@ _perldoc()
     local perl="${1%doc}"
     [[ $perl == $1 ]] || ! type $perl &>/dev/null && perl=
 
-    # complete builtin perl functions
     case $prev in
+        -h|-V|-n|-o|-M|-w|-L)
+            return 0
+            ;;
+        -d)
+            _filedir
+            return 0
+            ;;
         -f)
             _perlfunctions $perl
-             return 0
+            return 0
             ;;
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-h -v -t -u -m -l -F -X -f -q' -- "$cur" ))
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
     else
         # return available modules (unless it is clearly a file)
         if [[ "$cur" != @(*/|[.~])* ]]; then
diff --git a/test/lib/completions/perldoc.exp b/test/lib/completions/perldoc.exp
index 9a9d9fb..a745b55 100644
--- a/test/lib/completions/perldoc.exp
+++ b/test/lib/completions/perldoc.exp
@@ -24,17 +24,10 @@ expect {
     -re /@ { unresolved "$test" }
     default { unresolved "$test" }
 }
-
-
 sync_after_int
 
-set test "- should complete options"
-set options {
-    -h -v -t -u -m -l -F -X -f -q
-}
-assert_complete $options "perldoc -" $test
-
 
+assert_complete_any "perldoc -"
 sync_after_int
 
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list