ordinaryd 0.6.0

Ordinary Server
Documentation
_ordinaryd() {
    local i cur prev opts cmd
    COMPREPLY=()
    if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
        cur="$2"
    else
        cur="${COMP_WORDS[COMP_CWORD]}"
    fi
    prev="$3"
    cmd=""
    opts=""

    for i in "${COMP_WORDS[@]:0:COMP_CWORD}"
    do
        case "${cmd},${i}" in
            ",$1")
                cmd="ordinaryd"
                ;;
            ordinaryd,api)
                cmd="ordinaryd__subcmd__api"
                ;;
            ordinaryd,app)
                cmd="ordinaryd__subcmd__app"
                ;;
            ordinaryd,help)
                cmd="ordinaryd__subcmd__help"
                ;;
            ordinaryd,init)
                cmd="ordinaryd__subcmd__init"
                ;;
            ordinaryd__subcmd__help,api)
                cmd="ordinaryd__subcmd__help__subcmd__api"
                ;;
            ordinaryd__subcmd__help,app)
                cmd="ordinaryd__subcmd__help__subcmd__app"
                ;;
            ordinaryd__subcmd__help,help)
                cmd="ordinaryd__subcmd__help__subcmd__help"
                ;;
            ordinaryd__subcmd__help,init)
                cmd="ordinaryd__subcmd__help__subcmd__init"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        ordinaryd)
            opts="-h -V --data-dir --stored-logs --stdio-logs --stdio-logs-fmt --journald-logs --log-level --log-sizes --stdio-logs-timing --help --version init api app help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --data-dir)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --stdio-logs-fmt)
                    COMPREPLY=($(compgen -W "concise pretty json" -- "${cur}"))
                    return 0
                    ;;
                --log-level)
                    COMPREPLY=($(compgen -W "error warn info debug trace" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        ordinaryd__subcmd__api)
            opts="-h -V --environment --storage-size --provision --port --redirect-port --insecure --insecure-cookies --log-ttl-hours --log-rotation-file-size --log-rotation-mins --log-headers --log-ips --redacted-header-hash --dedicated-ports --swagger --data-dir --stored-logs --stdio-logs --stdio-logs-fmt --journald-logs --log-level --log-sizes --stdio-logs-timing --help --version"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --environment)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --storage-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --provision)
                    COMPREPLY=($(compgen -W "staging production localhost" -- "${cur}"))
                    return 0
                    ;;
                --port)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --redirect-port)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --log-ttl-hours)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --log-rotation-file-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --log-rotation-mins)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --redacted-header-hash)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data-dir)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --stdio-logs-fmt)
                    COMPREPLY=($(compgen -W "concise pretty json" -- "${cur}"))
                    return 0
                    ;;
                --log-level)
                    COMPREPLY=($(compgen -W "error warn info debug trace" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        ordinaryd__subcmd__app)
            opts="-p -h -V --provision --port --redirect-port --insecure --insecure-cookies --log-ttl-hours --log-rotation-file-size --log-rotation-mins --log-headers --log-ips --redacted-header-hash --project --domain-override --data-dir --stored-logs --stdio-logs --stdio-logs-fmt --journald-logs --log-level --log-sizes --stdio-logs-timing --help --version"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --provision)
                    COMPREPLY=($(compgen -W "staging production localhost" -- "${cur}"))
                    return 0
                    ;;
                --port)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --redirect-port)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --log-ttl-hours)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --log-rotation-file-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --log-rotation-mins)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --redacted-header-hash)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --project)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -p)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --domain-override)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data-dir)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --stdio-logs-fmt)
                    COMPREPLY=($(compgen -W "concise pretty json" -- "${cur}"))
                    return 0
                    ;;
                --log-level)
                    COMPREPLY=($(compgen -W "error warn info debug trace" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        ordinaryd__subcmd__help)
            opts="init api app help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        ordinaryd__subcmd__help__subcmd__api)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        ordinaryd__subcmd__help__subcmd__app)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        ordinaryd__subcmd__help__subcmd__help)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        ordinaryd__subcmd__help__subcmd__init)
            opts=""
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        ordinaryd__subcmd__init)
            opts="-h -V --environment --storage-size --api-domain --password --mfa-stored --api-contacts --app-domains --privileged-domains --data-dir --stored-logs --stdio-logs --stdio-logs-fmt --journald-logs --log-level --log-sizes --stdio-logs-timing --help --version"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --environment)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --storage-size)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --api-domain)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --password)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --api-contacts)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --app-domains)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --privileged-domains)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --data-dir)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --stdio-logs-fmt)
                    COMPREPLY=($(compgen -W "concise pretty json" -- "${cur}"))
                    return 0
                    ;;
                --log-level)
                    COMPREPLY=($(compgen -W "error warn info debug trace" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
    esac
}

if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
    complete -F _ordinaryd -o nosort -o bashdefault -o default ordinaryd
else
    complete -F _ordinaryd -o bashdefault -o default ordinaryd
fi