phing: Reuse ant completion for it, add basic test case.

This commit is contained in:
Ville Skyttä 2011-05-03 09:46:30 +03:00
parent 3e4aadd72d
commit 21c5a0eb9d
3 changed files with 27 additions and 5 deletions

View File

@ -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

View File

@ -0,0 +1 @@
assert_source_completions phing

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "phing -"
sync_after_int
teardown