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()
|
_ant()
|
||||||
{
|
{
|
||||||
@ -36,7 +36,7 @@ _ant()
|
|||||||
if [[ $cur == -D* ]]; then
|
if [[ $cur == -D* ]]; then
|
||||||
return 0
|
return 0
|
||||||
elif [[ "$cur" == -* ]]; then
|
elif [[ "$cur" == -* ]]; then
|
||||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
|
||||||
else
|
else
|
||||||
# available targets completion
|
# available targets completion
|
||||||
# find which buildfile to use
|
# find which buildfile to use
|
||||||
@ -57,8 +57,9 @@ _ant()
|
|||||||
-- "$cur" ) )
|
-- "$cur" ) )
|
||||||
fi
|
fi
|
||||||
} &&
|
} &&
|
||||||
have complete-ant-cmd.pl && \
|
have ant && { have complete-ant-cmd.pl && \
|
||||||
complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant
|
complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant; }
|
||||||
|
have phing && complete -F _ant phing
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# mode: shell-script
|
# 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