[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-259-g21c5a0e
Ville Skyttä
ville.skytta at iki.fi
Tue May 3 07:48:29 UTC 2011
The following commit has been merged in the master branch:
commit 21c5a0eb9d9b5c81f4822c42ca6f49beb701b168
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Tue May 3 09:46:30 2011 +0300
phing: Reuse ant completion for it, add basic test case.
diff --git a/completions/ant b/completions/ant
index 5f5ad10..79970da 100644
--- a/completions/ant
+++ b/completions/ant
@@ -1,6 +1,6 @@
-# bash completion for ant
+# bash completion for ant and phing
-have ant || return
+have ant || have phing || return
_ant()
{
@@ -36,7 +36,7 @@ _ant()
if [[ $cur == -D* ]]; then
return 0
elif [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
else
# available targets completion
# find which buildfile to use
@@ -57,8 +57,9 @@ _ant()
-- "$cur" ) )
fi
} &&
-have complete-ant-cmd.pl && \
- complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant
+have ant && { have complete-ant-cmd.pl && \
+ complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant; }
+have phing && complete -F _ant phing
# Local variables:
# mode: shell-script
diff --git a/test/completion/phing.exp b/test/completion/phing.exp
new file mode 100644
index 0000000..957999b
--- /dev/null
+++ b/test/completion/phing.exp
@@ -0,0 +1 @@
+assert_source_completions phing
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/phing.exp
similarity index 79%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/phing.exp
index 77cd07f..f064ea4 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/phing.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "a2ps "
+assert_complete_any "phing -"
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list