phing: Reuse ant completion for it, add basic test case.
This commit is contained in:
parent
3e4aadd72d
commit
21c5a0eb9d
@ -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
|
||||
|
1
test/completion/phing.exp
Normal file
1
test/completion/phing.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions phing
|
20
test/lib/completions/phing.exp
Normal file
20
test/lib/completions/phing.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "phing -"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user