# bash completion for check_dd-wrt_inet_access               -*- shell-script -*-

# arguments: [ROUTER [URL [SSH_TIMEOUT]]], or -h/--help
_check_dd_wrt_inet_access()
{
    local cur=${COMP_WORDS[COMP_CWORD]}
    COMPREPLY=()

    # only the router is completed, not the URL and the timeout
    if [[ $COMP_CWORD -eq 1 ]]; then
        if [[ $cur == -* ]]; then
            mapfile -t COMPREPLY < <(compgen -W '-h --help' -- "$cur")
        else
            mapfile -t COMPREPLY < <(compgen -A hostname -- "$cur")
        fi
    fi
}
complete -F _check_dd_wrt_inet_access check_dd-wrt_inet_access
