Skip to content

Instantly share code, notes, and snippets.

@krymen
Created November 21, 2012 11:16

Revisions

  1. krymen revised this gist Nov 21, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions phing
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # /etc/bash_completion.d/phing

    _phing () {
    local cur prev

  2. krymen created this gist Nov 21, 2012.
    15 changes: 15 additions & 0 deletions phing
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    _phing () {
    local cur prev

    COMPREPLY=()
    buildfile=build.xml
    _get_comp_words_by_ref cur prev

    [ ! -f $buildfile ] && return 0

    COMPREPLY=( $( compgen -W "$( cat $buildfile | tr "'\t\n>" "\" \n" | \
    sed -ne 's/.*<target .*name="\([^"]*\).*/\1/p' 2>/dev/null )" \
    -- "$cur" ) )
    }

    complete -F _phing phing