# Debian GNU/Linux geant(1) completion.
# Copyright 2004 "Patrick Ruckstuhl" <rupatric@student.ethz.ch>
#
have geant &&
_geant()
{
    local cur prev options

    # is there a build.eant file?
    [[ -f build.eant ]] || return 0

    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    prev=${COMP_WORDS[COMP_CWORD-1]}

    # get available targets
    options=`geant`
    # remove text around targets
    options=${options//geant/}
    options=${options//usage:/}

    COMPREPLY=( $( compgen -W "$options" | grep ^$cur ) )

    return 0

}
[ "$have" ] && complete -F _geant -o filenames geant
