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

    if [[ "${prev}" =~ ^()$ ]]; then
        COMPREPLY=( $(compgen -f -- "${cur}") )
    elif [[ "${prev}" =~ ^()$ ]]; then
        COMPREPLY=( $(compgen -d -- "${cur}") )
    else
        COMPREPLY=( $(compgen -W "--help --name --no-recurse --format --width --height --ratio --animated --no-animated --wrong-ext --ai --no-ai --print --print-comment --print-exif --exec --delete --dest --scale --resize-max --resize-w --resize-h --convert --quality" -- "${cur}") )
    fi
}

complete -F _ifind ifind
