[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 76cf12bc190035740387d4b45e64f53aef5bb4e7

Ville Skyttä ville.skytta at iki.fi
Fri Nov 19 20:14:14 UTC 2010


The following commit has been merged in the master branch:
commit 43ec91619dd2293bbbfa7bdfd31f748f9686b79e
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Nov 19 22:03:28 2010 +0200

    Add perl -m-/-M- completion.

diff --git a/completions/perl b/completions/perl
index 0862a8c..655ff65 100644
--- a/completions/perl
+++ b/completions/perl
@@ -43,6 +43,9 @@ _perl()
             return 0
             ;;
         -m|-M)
+            temp="${cur#-}"
+            prefix="$prefix${cur%$temp}"
+            cur="$temp"
             _perlmodules $1
             return 0
             ;;
diff --git a/test/lib/completions/perl.exp b/test/lib/completions/perl.exp
index 82a95bc..092aab3 100644
--- a/test/lib/completions/perl.exp
+++ b/test/lib/completions/perl.exp
@@ -105,4 +105,10 @@ sync_after_int
 assert_complete_any "perl -MFile::Spec::Func"
 sync_after_int
 
+assert_complete_any "perl -M-File"
+sync_after_int
+
+assert_complete_any "perl -m-File::"
+sync_after_int
+
 teardown

-- 
bash-completion



More information about the Bash-completion-commits mailing list