diff --git a/completions/ant b/completions/ant index 5f5ad10e..79970daf 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 00000000..957999bc --- /dev/null +++ b/test/completion/phing.exp @@ -0,0 +1 @@ +assert_source_completions phing diff --git a/test/lib/completions/phing.exp b/test/lib/completions/phing.exp new file mode 100644 index 00000000..f064ea4a --- /dev/null +++ b/test/lib/completions/phing.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "phing -" + + +sync_after_int + + +teardown