# iep-collector-addtest(1) completion                       -*- shell-script -*-

_iep_collector_addtest ()
{
    local IFS=$'\n'
    local LASTCHAR=' '
    
    COMPREPLY=($(compgen -o plusdirs -f -X '!*.test' \
        -- "${COMP_WORDS[COMP_CWORD]}"))
    
    if [ ${#COMPREPLY[@]} = 1 ]; then
        [ -d "$COMPREPLY" ] && LASTCHAR=/
        COMPREPLY=$(printf %q%s "$COMPREPLY" "$LASTCHAR")
    else
        for ((i=0; i < ${#COMPREPLY[@]}; i++)); do
            [ -d "${COMPREPLY[$i]}" ] && COMPREPLY[$i]=${COMPREPLY[$i]}/
        done
    fi
} &&
complete -o nospace -F _iep_collector_addtest iep-collector-addtest

# ex: ts=4 sw=4 et filetype=sh
