

__kubectl_bash_source() {
	alias shopt=':'
	alias _expand=_bash_expand
	alias _complete=_bash_comp
	emulate -L sh
	setopt kshglob noshglob braceexpand

	source "$@"
}

__kubectl_type() {
	# -t is not supported by zsh
	if [ "$1" == "-t" ]; then
		shift

		# fake Bash 4 to disable "complete -o nospace". Instead
		# "compopt +-o nospace" is used in the code to toggle trailing
		# spaces. We don't support that, but leave trailing spaces on
		# all the time
		if [ "$1" = "__kubectl_compopt" ]; then
			echo builtin
			return 0
		fi
	fi
	type "$@"
}

__kubectl_compgen() {
	local completions w
	completions=( $(compgen "$@") ) || return $?

	# filter by given word as prefix
	while [[ "$1" = -* && "$1" != -- ]]; do
		shift
		shift
	done
	if [[ "$1" == -- ]]; then
		shift
	fi
	for w in "${completions[@]}"; do
		if [[ "${w}" = "$1"* ]]; then
			echo "${w}"
		fi
	done
}

__kubectl_compopt() {
	true # don't do anything. Not supported by bashcompinit in zsh
}

__kubectl_declare() {
	if [ "$1" == "-F" ]; then
		whence -w "$@"
	else
		builtin declare "$@"
	fi
}

__kubectl_ltrim_colon_completions()
{
	if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then
		# Remove colon-word prefix from COMPREPLY items
		local colon_word=${1%${1##*:}}
		local i=${#COMPREPLY[*]}
		while [[ $((--i)) -ge 0 ]]; do
			COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"}
		done
	fi
}

__kubectl_get_comp_words_by_ref() {
	cur="${COMP_WORDS[COMP_CWORD]}"
	prev="${COMP_WORDS[${COMP_CWORD}-1]}"
	words=("${COMP_WORDS[@]}")
	cword=("${COMP_CWORD[@]}")
}

__kubectl_filedir() {
	local RET OLD_IFS w qw

	__debug "_filedir $@ cur=$cur"
	if [[ "$1" = \~* ]]; then
		# somehow does not work. Maybe, zsh does not call this at all
		eval echo "$1"
		return 0
	fi

	OLD_IFS="$IFS"
	IFS=$'\n'
	if [ "$1" = "-d" ]; then
		shift
		RET=( $(compgen -d) )
	else
		RET=( $(compgen -f) )
	fi
	IFS="$OLD_IFS"

	IFS="," __debug "RET=${RET[@]} len=${#RET[@]}"

	for w in ${RET[@]}; do
		if [[ ! "${w}" = "${cur}"* ]]; then
			continue
		fi
		if eval "[[ \"\${w}\" = *.$1 || -d \"\${w}\" ]]"; then
			qw="$(__kubectl_quote "${w}")"
			if [ -d "${w}" ]; then
				COMPREPLY+=("${qw}/")
			else
				COMPREPLY+=("${qw}")
			fi
		fi
	done
}

__kubectl_quote() {
    if [[ $1 == \'* || $1 == \"* ]]; then
        # Leave out first character
        printf %q "${1:1}"
    else
    	printf %q "$1"
    fi
}

autoload -U +X bashcompinit && bashcompinit

# use word boundary patterns for BSD or GNU sed
LWORD='[[:<:]]'
RWORD='[[:>:]]'
if sed --help 2>&1 | grep -q GNU; then
	LWORD='\<'
	RWORD='\>'
fi

__kubectl_convert_bash_to_zsh() {
	sed \
	-e 's/declare -F/whence -w/' \
	-e 's/local \([a-zA-Z0-9_]*\)=/local \1; \1=/' \
	-e 's/flags+=("\(--.*\)=")/flags+=("\1"); two_word_flags+=("\1")/' \
	-e 's/must_have_one_flag+=("\(--.*\)=")/must_have_one_flag+=("\1")/' \
	-e "s/${LWORD}_filedir${RWORD}/__kubectl_filedir/g" \
	-e "s/${LWORD}_get_comp_words_by_ref${RWORD}/__kubectl_get_comp_words_by_ref/g" \
	-e "s/${LWORD}__ltrim_colon_completions${RWORD}/__kubectl_ltrim_colon_completions/g" \
	-e "s/${LWORD}compgen${RWORD}/__kubectl_compgen/g" \
	-e "s/${LWORD}compopt${RWORD}/__kubectl_compopt/g" \
	-e "s/${LWORD}declare${RWORD}/__kubectl_declare/g" \
	-e "s/\\\$(type${RWORD}/\$(__kubectl_type/g" \
	<<'BASH_COMPLETION_EOF'
# bash completion for oadm                                 -*- shell-script -*-

__debug()
{
    if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
    fi
}

# Homebrew on Macs have version 1.3 of bash-completion which doesn't include
# _init_completion. This is a very minimal version of that function.
__my_init_completion()
{
    COMPREPLY=()
    _get_comp_words_by_ref "$@" cur prev words cword
}

__index_of_word()
{
    local w word=$1
    shift
    index=0
    for w in "$@"; do
        [[ $w = "$word" ]] && return
        index=$((index+1))
    done
    index=-1
}

__contains_word()
{
    local w word=$1; shift
    for w in "$@"; do
        [[ $w = "$word" ]] && return
    done
    return 1
}

__handle_reply()
{
    __debug "${FUNCNAME[0]}"
    case $cur in
        -*)
            if [[ $(type -t compopt) = "builtin" ]]; then
                compopt -o nospace
            fi
            local allflags
            if [ ${#must_have_one_flag[@]} -ne 0 ]; then
                allflags=("${must_have_one_flag[@]}")
            else
                allflags=("${flags[*]} ${two_word_flags[*]}")
            fi
            COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") )
            if [[ $(type -t compopt) = "builtin" ]]; then
                [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
            fi

            # complete after --flag=abc
            if [[ $cur == *=* ]]; then
                if [[ $(type -t compopt) = "builtin" ]]; then
                    compopt +o nospace
                fi

                local index flag
                flag="${cur%%=*}"
                __index_of_word "${flag}" "${flags_with_completion[@]}"
                if [[ ${index} -ge 0 ]]; then
                    COMPREPLY=()
                    PREFIX=""
                    cur="${cur#*=}"
                    ${flags_completion[${index}]}
                    if [ -n "${ZSH_VERSION}" ]; then
                        # zfs completion needs --flag= prefix
                        eval "COMPREPLY=( \"\${COMPREPLY[@]/#/${flag}=}\" )"
                    fi
                fi
            fi
            return 0;
            ;;
    esac

    # check if we are handling a flag with special work handling
    local index
    __index_of_word "${prev}" "${flags_with_completion[@]}"
    if [[ ${index} -ge 0 ]]; then
        ${flags_completion[${index}]}
        return
    fi

    # we are parsing a flag and don't have a special handler, no completion
    if [[ ${cur} != "${words[cword]}" ]]; then
        return
    fi

    local completions
    completions=("${commands[@]}")
    if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then
        completions=("${must_have_one_noun[@]}")
    fi
    if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
        completions+=("${must_have_one_flag[@]}")
    fi
    COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )

    if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
        COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") )
    fi

    if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
        declare -F __custom_func >/dev/null && __custom_func
    fi

    __ltrim_colon_completions "$cur"
}

# The arguments should be in the form "ext1|ext2|extn"
__handle_filename_extension_flag()
{
    local ext="$1"
    _filedir "@(${ext})"
}

__handle_subdirs_in_dir_flag()
{
    local dir="$1"
    pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1
}

__handle_flag()
{
    __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"

    # if a command required a flag, and we found it, unset must_have_one_flag()
    local flagname=${words[c]}
    local flagvalue
    # if the word contained an =
    if [[ ${words[c]} == *"="* ]]; then
        flagvalue=${flagname#*=} # take in as flagvalue after the =
        flagname=${flagname%%=*} # strip everything after the =
        flagname="${flagname}=" # but put the = back
    fi
    __debug "${FUNCNAME[0]}: looking for ${flagname}"
    if __contains_word "${flagname}" "${must_have_one_flag[@]}"; then
        must_have_one_flag=()
    fi

    # if you set a flag which only applies to this command, don't show subcommands
    if __contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then
      commands=()
    fi

    # keep flag value with flagname as flaghash
    if [ -n "${flagvalue}" ] ; then
        flaghash[${flagname}]=${flagvalue}
    elif [ -n "${words[ $((c+1)) ]}" ] ; then
        flaghash[${flagname}]=${words[ $((c+1)) ]}
    else
        flaghash[${flagname}]="true" # pad "true" for bool flag
    fi

    # skip the argument to a two word flag
    if __contains_word "${words[c]}" "${two_word_flags[@]}"; then
        c=$((c+1))
        # if we are looking for a flags value, don't show commands
        if [[ $c -eq $cword ]]; then
            commands=()
        fi
    fi

    c=$((c+1))

}

__handle_noun()
{
    __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"

    if __contains_word "${words[c]}" "${must_have_one_noun[@]}"; then
        must_have_one_noun=()
    elif __contains_word "${words[c]}" "${noun_aliases[@]}"; then
        must_have_one_noun=()
    fi

    nouns+=("${words[c]}")
    c=$((c+1))
}

__handle_command()
{
    __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"

    local next_command
    if [[ -n ${last_command} ]]; then
        next_command="_${last_command}_${words[c]//:/__}"
    else
        if [[ $c -eq 0 ]]; then
            next_command="_$(basename "${words[c]//:/__}")"
        else
            next_command="_${words[c]//:/__}"
        fi
    fi
    c=$((c+1))
    __debug "${FUNCNAME[0]}: looking for ${next_command}"
    declare -F $next_command >/dev/null && $next_command
}

__handle_word()
{
    if [[ $c -ge $cword ]]; then
        __handle_reply
        return
    fi
    __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
    if [[ "${words[c]}" == -* ]]; then
        __handle_flag
    elif __contains_word "${words[c]}" "${commands[@]}"; then
        __handle_command
    elif [[ $c -eq 0 ]] && __contains_word "$(basename "${words[c]}")" "${commands[@]}"; then
        __handle_command
    else
        __handle_noun
    fi
    __handle_word
}

_oadm_build-chain()
{
    last_command="oadm_build-chain"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--all")
    local_nonpersistent_flags+=("--all")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--reverse")
    local_nonpersistent_flags+=("--reverse")
    flags+=("--trigger-only")
    local_nonpersistent_flags+=("--trigger-only")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_ca_create-key-pair()
{
    last_command="oadm_ca_create-key-pair"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--overwrite")
    local_nonpersistent_flags+=("--overwrite")
    flags+=("--private-key=")
    flags_with_completion+=("--private-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--private-key=")
    flags+=("--public-key=")
    flags_with_completion+=("--public-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--public-key=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_ca_create-master-certs()
{
    last_command="oadm_ca_create-master-certs"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--cert-dir=")
    flags_with_completion+=("--cert-dir")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--cert-dir=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--certificate-authority=")
    flags+=("--expire-days=")
    local_nonpersistent_flags+=("--expire-days=")
    flags+=("--hostnames=")
    local_nonpersistent_flags+=("--hostnames=")
    flags+=("--master=")
    local_nonpersistent_flags+=("--master=")
    flags+=("--overwrite")
    local_nonpersistent_flags+=("--overwrite")
    flags+=("--public-master=")
    local_nonpersistent_flags+=("--public-master=")
    flags+=("--signer-expire-days=")
    local_nonpersistent_flags+=("--signer-expire-days=")
    flags+=("--signer-name=")
    local_nonpersistent_flags+=("--signer-name=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_ca_create-server-cert()
{
    last_command="oadm_ca_create-server-cert"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--cert=")
    flags_with_completion+=("--cert")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--cert=")
    flags+=("--expire-days=")
    local_nonpersistent_flags+=("--expire-days=")
    flags+=("--hostnames=")
    local_nonpersistent_flags+=("--hostnames=")
    flags+=("--key=")
    flags_with_completion+=("--key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--key=")
    flags+=("--overwrite")
    local_nonpersistent_flags+=("--overwrite")
    flags+=("--signer-cert=")
    flags_with_completion+=("--signer-cert")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-cert=")
    flags+=("--signer-key=")
    flags_with_completion+=("--signer-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-key=")
    flags+=("--signer-serial=")
    flags_with_completion+=("--signer-serial")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-serial=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_ca_create-signer-cert()
{
    last_command="oadm_ca_create-signer-cert"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--cert=")
    flags_with_completion+=("--cert")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--cert=")
    flags+=("--expire-days=")
    local_nonpersistent_flags+=("--expire-days=")
    flags+=("--key=")
    flags_with_completion+=("--key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--key=")
    flags+=("--name=")
    local_nonpersistent_flags+=("--name=")
    flags+=("--overwrite")
    local_nonpersistent_flags+=("--overwrite")
    flags+=("--serial=")
    flags_with_completion+=("--serial")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--serial=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_ca_decrypt()
{
    last_command="oadm_ca_decrypt"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--in=")
    flags_with_completion+=("--in")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--in=")
    flags+=("--key=")
    flags_with_completion+=("--key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--key=")
    flags+=("--out=")
    flags_with_completion+=("--out")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--out=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_ca_encrypt()
{
    last_command="oadm_ca_encrypt"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--genkey=")
    flags_with_completion+=("--genkey")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--genkey=")
    flags+=("--in=")
    flags_with_completion+=("--in")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--in=")
    flags+=("--key=")
    flags_with_completion+=("--key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--key=")
    flags+=("--out=")
    flags_with_completion+=("--out")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--out=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_ca()
{
    last_command="oadm_ca"
    commands=()
    commands+=("create-key-pair")
    commands+=("create-master-certs")
    commands+=("create-server-cert")
    commands+=("create-signer-cert")
    commands+=("decrypt")
    commands+=("encrypt")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_certificate_approve()
{
    last_command="oadm_certificate_approve"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--filename=")
    flags_with_completion+=("--filename")
    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
    two_word_flags+=("-f")
    flags_with_completion+=("-f")
    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
    local_nonpersistent_flags+=("--filename=")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--recursive")
    flags+=("-R")
    local_nonpersistent_flags+=("--recursive")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_certificate_deny()
{
    last_command="oadm_certificate_deny"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--filename=")
    flags_with_completion+=("--filename")
    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
    two_word_flags+=("-f")
    flags_with_completion+=("-f")
    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
    local_nonpersistent_flags+=("--filename=")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--recursive")
    flags+=("-R")
    local_nonpersistent_flags+=("--recursive")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_certificate()
{
    last_command="oadm_certificate"
    commands=()
    commands+=("approve")
    commands+=("deny")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_completion()
{
    last_command="oadm_completion"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    must_have_one_noun+=("bash")
    must_have_one_noun+=("zsh")
    noun_aliases=()
}

_oadm_config_current-context()
{
    last_command="oadm_config_current-context"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_delete-cluster()
{
    last_command="oadm_config_delete-cluster"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_delete-context()
{
    last_command="oadm_config_delete-context"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_get-clusters()
{
    last_command="oadm_config_get-clusters"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_get-contexts()
{
    last_command="oadm_config_get-contexts"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_set()
{
    last_command="oadm_config_set"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--set-raw-bytes")
    local_nonpersistent_flags+=("--set-raw-bytes")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_set-cluster()
{
    last_command="oadm_config_set-cluster"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--api-version=")
    local_nonpersistent_flags+=("--api-version=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--certificate-authority=")
    flags+=("--embed-certs")
    local_nonpersistent_flags+=("--embed-certs")
    flags+=("--insecure-skip-tls-verify")
    local_nonpersistent_flags+=("--insecure-skip-tls-verify")
    flags+=("--server=")
    local_nonpersistent_flags+=("--server=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_set-context()
{
    last_command="oadm_config_set-context"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--cluster=")
    local_nonpersistent_flags+=("--cluster=")
    flags+=("--namespace=")
    local_nonpersistent_flags+=("--namespace=")
    flags+=("--user=")
    local_nonpersistent_flags+=("--user=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_set-credentials()
{
    last_command="oadm_config_set-credentials"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--auth-provider=")
    local_nonpersistent_flags+=("--auth-provider=")
    flags+=("--auth-provider-arg=")
    local_nonpersistent_flags+=("--auth-provider-arg=")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--client-certificate=")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--client-key=")
    flags+=("--embed-certs")
    local_nonpersistent_flags+=("--embed-certs")
    flags+=("--password=")
    local_nonpersistent_flags+=("--password=")
    flags+=("--token=")
    local_nonpersistent_flags+=("--token=")
    flags+=("--username=")
    local_nonpersistent_flags+=("--username=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_unset()
{
    last_command="oadm_config_unset"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_use-context()
{
    last_command="oadm_config_use-context"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config_view()
{
    last_command="oadm_config_view"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--flatten")
    local_nonpersistent_flags+=("--flatten")
    flags+=("--merge")
    local_nonpersistent_flags+=("--merge")
    flags+=("--minify")
    local_nonpersistent_flags+=("--minify")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--raw")
    local_nonpersistent_flags+=("--raw")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_config()
{
    last_command="oadm_config"
    commands=()
    commands+=("current-context")
    commands+=("delete-cluster")
    commands+=("delete-context")
    commands+=("get-clusters")
    commands+=("get-contexts")
    commands+=("set")
    commands+=("set-cluster")
    commands+=("set-context")
    commands+=("set-credentials")
    commands+=("unset")
    commands+=("use-context")
    commands+=("view")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--config=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_cordon()
{
    last_command="oadm_cordon"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_create-api-client-config()
{
    last_command="oadm_create-api-client-config"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--basename=")
    local_nonpersistent_flags+=("--basename=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--certificate-authority=")
    flags+=("--client-dir=")
    flags_with_completion+=("--client-dir")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--client-dir=")
    flags+=("--expire-days=")
    local_nonpersistent_flags+=("--expire-days=")
    flags+=("--groups=")
    local_nonpersistent_flags+=("--groups=")
    flags+=("--master=")
    local_nonpersistent_flags+=("--master=")
    flags+=("--public-master=")
    local_nonpersistent_flags+=("--public-master=")
    flags+=("--signer-cert=")
    flags_with_completion+=("--signer-cert")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-cert=")
    flags+=("--signer-key=")
    flags_with_completion+=("--signer-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-key=")
    flags+=("--signer-serial=")
    flags_with_completion+=("--signer-serial")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-serial=")
    flags+=("--user=")
    local_nonpersistent_flags+=("--user=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_create-bootstrap-policy-file()
{
    last_command="oadm_create-bootstrap-policy-file"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--filename=")
    flags_with_completion+=("--filename")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--filename=")
    flags+=("--openshift-namespace=")
    local_nonpersistent_flags+=("--openshift-namespace=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_create-bootstrap-project-template()
{
    last_command="oadm_create-bootstrap-project-template"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--name=")
    local_nonpersistent_flags+=("--name=")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_create-error-template()
{
    last_command="oadm_create-error-template"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_create-kubeconfig()
{
    last_command="oadm_create-kubeconfig"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--certificate-authority=")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--client-certificate=")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--client-key=")
    flags+=("--kubeconfig=")
    flags_with_completion+=("--kubeconfig")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--kubeconfig=")
    flags+=("--master=")
    local_nonpersistent_flags+=("--master=")
    flags+=("--namespace=")
    local_nonpersistent_flags+=("--namespace=")
    flags+=("--public-master=")
    local_nonpersistent_flags+=("--public-master=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_create-login-template()
{
    last_command="oadm_create-login-template"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_create-node-config()
{
    last_command="oadm_create-node-config"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--allow-disabled-docker")
    local_nonpersistent_flags+=("--allow-disabled-docker")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--certificate-authority=")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--client-certificate=")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--client-key=")
    flags+=("--dns-domain=")
    local_nonpersistent_flags+=("--dns-domain=")
    flags+=("--dns-ip=")
    local_nonpersistent_flags+=("--dns-ip=")
    flags+=("--expire-days=")
    local_nonpersistent_flags+=("--expire-days=")
    flags+=("--hostnames=")
    local_nonpersistent_flags+=("--hostnames=")
    flags+=("--images=")
    local_nonpersistent_flags+=("--images=")
    flags+=("--latest-images")
    local_nonpersistent_flags+=("--latest-images")
    flags+=("--listen=")
    local_nonpersistent_flags+=("--listen=")
    flags+=("--master=")
    local_nonpersistent_flags+=("--master=")
    flags+=("--network-plugin=")
    local_nonpersistent_flags+=("--network-plugin=")
    flags+=("--node=")
    local_nonpersistent_flags+=("--node=")
    flags+=("--node-client-certificate-authority=")
    flags_with_completion+=("--node-client-certificate-authority")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--node-client-certificate-authority=")
    flags+=("--node-dir=")
    flags_with_completion+=("--node-dir")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--node-dir=")
    flags+=("--server-certificate=")
    flags_with_completion+=("--server-certificate")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--server-certificate=")
    flags+=("--server-key=")
    flags_with_completion+=("--server-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--server-key=")
    flags+=("--signer-cert=")
    flags_with_completion+=("--signer-cert")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-cert=")
    flags+=("--signer-key=")
    flags_with_completion+=("--signer-key")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-key=")
    flags+=("--signer-serial=")
    flags_with_completion+=("--signer-serial")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--signer-serial=")
    flags+=("--volume-dir=")
    flags_with_completion+=("--volume-dir")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--volume-dir=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_create-provider-selection-template()
{
    last_command="oadm_create-provider-selection-template"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_diagnostics()
{
    last_command="oadm_diagnostics"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--cluster-context=")
    local_nonpersistent_flags+=("--cluster-context=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--config=")
    flags+=("--context=")
    local_nonpersistent_flags+=("--context=")
    flags+=("--diaglevel=")
    two_word_flags+=("-l")
    local_nonpersistent_flags+=("--diaglevel=")
    flags+=("--host")
    local_nonpersistent_flags+=("--host")
    flags+=("--images=")
    local_nonpersistent_flags+=("--images=")
    flags+=("--latest-images")
    local_nonpersistent_flags+=("--latest-images")
    flags+=("--loglevel=")
    local_nonpersistent_flags+=("--loglevel=")
    flags+=("--logspec=")
    local_nonpersistent_flags+=("--logspec=")
    flags+=("--master-config=")
    local_nonpersistent_flags+=("--master-config=")
    flags+=("--network-logdir=")
    local_nonpersistent_flags+=("--network-logdir=")
    flags+=("--node-config=")
    local_nonpersistent_flags+=("--node-config=")
    flags+=("--prevent-modification")
    local_nonpersistent_flags+=("--prevent-modification")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_drain()
{
    last_command="oadm_drain"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--delete-local-data")
    local_nonpersistent_flags+=("--delete-local-data")
    flags+=("--force")
    local_nonpersistent_flags+=("--force")
    flags+=("--grace-period=")
    local_nonpersistent_flags+=("--grace-period=")
    flags+=("--ignore-daemonsets")
    local_nonpersistent_flags+=("--ignore-daemonsets")
    flags+=("--timeout=")
    local_nonpersistent_flags+=("--timeout=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_groups_add-users()
{
    last_command="oadm_groups_add-users"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_groups_new()
{
    last_command="oadm_groups_new"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_groups_prune()
{
    last_command="oadm_groups_prune"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--blacklist=")
    flags_with_completion+=("--blacklist")
    flags_completion+=("__handle_filename_extension_flag txt")
    local_nonpersistent_flags+=("--blacklist=")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--sync-config=")
    flags_with_completion+=("--sync-config")
    flags_completion+=("__handle_filename_extension_flag yaml|yml")
    local_nonpersistent_flags+=("--sync-config=")
    flags+=("--whitelist=")
    flags_with_completion+=("--whitelist")
    flags_completion+=("__handle_filename_extension_flag txt")
    local_nonpersistent_flags+=("--whitelist=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_groups_remove-users()
{
    last_command="oadm_groups_remove-users"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_groups_sync()
{
    last_command="oadm_groups_sync"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--blacklist=")
    flags_with_completion+=("--blacklist")
    flags_completion+=("__handle_filename_extension_flag txt")
    local_nonpersistent_flags+=("--blacklist=")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--sync-config=")
    flags_with_completion+=("--sync-config")
    flags_completion+=("__handle_filename_extension_flag yaml|yml")
    local_nonpersistent_flags+=("--sync-config=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--type=")
    local_nonpersistent_flags+=("--type=")
    flags+=("--whitelist=")
    flags_with_completion+=("--whitelist")
    flags_completion+=("__handle_filename_extension_flag txt")
    local_nonpersistent_flags+=("--whitelist=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_groups()
{
    last_command="oadm_groups"
    commands=()
    commands+=("add-users")
    commands+=("new")
    commands+=("prune")
    commands+=("remove-users")
    commands+=("sync")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_ipfailover()
{
    last_command="oadm_ipfailover"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--check-interval=")
    local_nonpersistent_flags+=("--check-interval=")
    flags+=("--check-script=")
    local_nonpersistent_flags+=("--check-script=")
    flags+=("--create")
    local_nonpersistent_flags+=("--create")
    flags+=("--dry-run")
    local_nonpersistent_flags+=("--dry-run")
    flags+=("--images=")
    local_nonpersistent_flags+=("--images=")
    flags+=("--interface=")
    two_word_flags+=("-i")
    local_nonpersistent_flags+=("--interface=")
    flags+=("--iptables-chain=")
    local_nonpersistent_flags+=("--iptables-chain=")
    flags+=("--latest-images")
    local_nonpersistent_flags+=("--latest-images")
    flags+=("--notify-script=")
    local_nonpersistent_flags+=("--notify-script=")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--replicas=")
    two_word_flags+=("-r")
    local_nonpersistent_flags+=("--replicas=")
    flags+=("--selector=")
    two_word_flags+=("-l")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--service-account=")
    local_nonpersistent_flags+=("--service-account=")
    flags+=("--type=")
    local_nonpersistent_flags+=("--type=")
    flags+=("--virtual-ips=")
    local_nonpersistent_flags+=("--virtual-ips=")
    flags+=("--vrrp-id-offset=")
    local_nonpersistent_flags+=("--vrrp-id-offset=")
    flags+=("--watch-port=")
    two_word_flags+=("-w")
    local_nonpersistent_flags+=("--watch-port=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_manage-node()
{
    last_command="oadm_manage-node"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--dry-run")
    local_nonpersistent_flags+=("--dry-run")
    flags+=("--force")
    local_nonpersistent_flags+=("--force")
    flags+=("--grace-period=")
    local_nonpersistent_flags+=("--grace-period=")
    flags+=("--list-pods")
    local_nonpersistent_flags+=("--list-pods")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--pod-selector=")
    local_nonpersistent_flags+=("--pod-selector=")
    flags+=("--schedulable")
    local_nonpersistent_flags+=("--schedulable")
    flags+=("--selector=")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_migrate_image-references()
{
    last_command="oadm_migrate_image-references"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--all-namespaces")
    local_nonpersistent_flags+=("--all-namespaces")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--filename=")
    flags_with_completion+=("--filename")
    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
    two_word_flags+=("-f")
    flags_with_completion+=("-f")
    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
    local_nonpersistent_flags+=("--filename=")
    flags+=("--from-key=")
    local_nonpersistent_flags+=("--from-key=")
    flags+=("--include=")
    local_nonpersistent_flags+=("--include=")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--to-key=")
    local_nonpersistent_flags+=("--to-key=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_flag+=("--filename=")
    must_have_one_flag+=("-f")
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_migrate_storage()
{
    last_command="oadm_migrate_storage"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--all-namespaces")
    local_nonpersistent_flags+=("--all-namespaces")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--filename=")
    flags_with_completion+=("--filename")
    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
    two_word_flags+=("-f")
    flags_with_completion+=("-f")
    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
    local_nonpersistent_flags+=("--filename=")
    flags+=("--from-key=")
    local_nonpersistent_flags+=("--from-key=")
    flags+=("--include=")
    local_nonpersistent_flags+=("--include=")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--to-key=")
    local_nonpersistent_flags+=("--to-key=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_flag+=("--filename=")
    must_have_one_flag+=("-f")
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_migrate()
{
    last_command="oadm_migrate"
    commands=()
    commands+=("image-references")
    commands+=("storage")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_new-project()
{
    last_command="oadm_new-project"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--admin=")
    local_nonpersistent_flags+=("--admin=")
    flags+=("--admin-role=")
    local_nonpersistent_flags+=("--admin-role=")
    flags+=("--description=")
    local_nonpersistent_flags+=("--description=")
    flags+=("--display-name=")
    local_nonpersistent_flags+=("--display-name=")
    flags+=("--node-selector=")
    local_nonpersistent_flags+=("--node-selector=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_options()
{
    last_command="oadm_options"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_overwrite-policy()
{
    last_command="oadm_overwrite-policy"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--filename=")
    flags_with_completion+=("--filename")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--filename=")
    flags+=("--force")
    flags+=("-f")
    local_nonpersistent_flags+=("--force")
    flags+=("--master-config=")
    flags_with_completion+=("--master-config")
    flags_completion+=("__handle_filename_extension_flag yaml|yml")
    local_nonpersistent_flags+=("--master-config=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_pod-network_isolate-projects()
{
    last_command="oadm_pod-network_isolate-projects"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--selector=")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_pod-network_join-projects()
{
    last_command="oadm_pod-network_join-projects"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--selector=")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--to=")
    local_nonpersistent_flags+=("--to=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_pod-network_make-projects-global()
{
    last_command="oadm_pod-network_make-projects-global"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--selector=")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_pod-network()
{
    last_command="oadm_pod-network"
    commands=()
    commands+=("isolate-projects")
    commands+=("join-projects")
    commands+=("make-projects-global")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_add-cluster-role-to-group()
{
    last_command="oadm_policy_add-cluster-role-to-group"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_add-cluster-role-to-user()
{
    last_command="oadm_policy_add-cluster-role-to-user"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_add-role-to-group()
{
    last_command="oadm_policy_add-role-to-group"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--role-namespace=")
    local_nonpersistent_flags+=("--role-namespace=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_add-role-to-user()
{
    last_command="oadm_policy_add-role-to-user"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--role-namespace=")
    local_nonpersistent_flags+=("--role-namespace=")
    flags+=("--serviceaccount=")
    two_word_flags+=("-z")
    local_nonpersistent_flags+=("--serviceaccount=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_add-scc-to-group()
{
    last_command="oadm_policy_add-scc-to-group"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_add-scc-to-user()
{
    last_command="oadm_policy_add-scc-to-user"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--serviceaccount=")
    two_word_flags+=("-z")
    local_nonpersistent_flags+=("--serviceaccount=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_reconcile-cluster-role-bindings()
{
    last_command="oadm_policy_reconcile-cluster-role-bindings"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--additive-only")
    local_nonpersistent_flags+=("--additive-only")
    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--exclude-groups=")
    local_nonpersistent_flags+=("--exclude-groups=")
    flags+=("--exclude-users=")
    local_nonpersistent_flags+=("--exclude-users=")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_reconcile-cluster-roles()
{
    last_command="oadm_policy_reconcile-cluster-roles"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--additive-only")
    local_nonpersistent_flags+=("--additive-only")
    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_reconcile-sccs()
{
    last_command="oadm_policy_reconcile-sccs"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--additive-only")
    local_nonpersistent_flags+=("--additive-only")
    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--infrastructure-namespace=")
    local_nonpersistent_flags+=("--infrastructure-namespace=")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_remove-cluster-role-from-group()
{
    last_command="oadm_policy_remove-cluster-role-from-group"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_remove-cluster-role-from-user()
{
    last_command="oadm_policy_remove-cluster-role-from-user"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_remove-group()
{
    last_command="oadm_policy_remove-group"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_remove-role-from-group()
{
    last_command="oadm_policy_remove-role-from-group"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--role-namespace=")
    local_nonpersistent_flags+=("--role-namespace=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_remove-role-from-user()
{
    last_command="oadm_policy_remove-role-from-user"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--role-namespace=")
    local_nonpersistent_flags+=("--role-namespace=")
    flags+=("--serviceaccount=")
    two_word_flags+=("-z")
    local_nonpersistent_flags+=("--serviceaccount=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_remove-scc-from-group()
{
    last_command="oadm_policy_remove-scc-from-group"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_remove-scc-from-user()
{
    last_command="oadm_policy_remove-scc-from-user"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--serviceaccount=")
    two_word_flags+=("-z")
    local_nonpersistent_flags+=("--serviceaccount=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_remove-user()
{
    last_command="oadm_policy_remove-user"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy_who-can()
{
    last_command="oadm_policy_who-can"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--all-namespaces")
    local_nonpersistent_flags+=("--all-namespaces")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_policy()
{
    last_command="oadm_policy"
    commands=()
    commands+=("add-cluster-role-to-group")
    commands+=("add-cluster-role-to-user")
    commands+=("add-role-to-group")
    commands+=("add-role-to-user")
    commands+=("add-scc-to-group")
    commands+=("add-scc-to-user")
    commands+=("reconcile-cluster-role-bindings")
    commands+=("reconcile-cluster-roles")
    commands+=("reconcile-sccs")
    commands+=("remove-cluster-role-from-group")
    commands+=("remove-cluster-role-from-user")
    commands+=("remove-group")
    commands+=("remove-role-from-group")
    commands+=("remove-role-from-user")
    commands+=("remove-scc-from-group")
    commands+=("remove-scc-from-user")
    commands+=("remove-user")
    commands+=("who-can")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_prune_builds()
{
    last_command="oadm_prune_builds"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--keep-complete=")
    local_nonpersistent_flags+=("--keep-complete=")
    flags+=("--keep-failed=")
    local_nonpersistent_flags+=("--keep-failed=")
    flags+=("--keep-younger-than=")
    local_nonpersistent_flags+=("--keep-younger-than=")
    flags+=("--orphans")
    local_nonpersistent_flags+=("--orphans")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_prune_deployments()
{
    last_command="oadm_prune_deployments"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--keep-complete=")
    local_nonpersistent_flags+=("--keep-complete=")
    flags+=("--keep-failed=")
    local_nonpersistent_flags+=("--keep-failed=")
    flags+=("--keep-younger-than=")
    local_nonpersistent_flags+=("--keep-younger-than=")
    flags+=("--orphans")
    local_nonpersistent_flags+=("--orphans")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_prune_groups()
{
    last_command="oadm_prune_groups"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--blacklist=")
    flags_with_completion+=("--blacklist")
    flags_completion+=("__handle_filename_extension_flag txt")
    local_nonpersistent_flags+=("--blacklist=")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--sync-config=")
    flags_with_completion+=("--sync-config")
    flags_completion+=("__handle_filename_extension_flag yaml|yml")
    local_nonpersistent_flags+=("--sync-config=")
    flags+=("--whitelist=")
    flags_with_completion+=("--whitelist")
    flags_completion+=("__handle_filename_extension_flag txt")
    local_nonpersistent_flags+=("--whitelist=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_prune_images()
{
    last_command="oadm_prune_images"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--all")
    local_nonpersistent_flags+=("--all")
    flags+=("--certificate-authority=")
    local_nonpersistent_flags+=("--certificate-authority=")
    flags+=("--confirm")
    local_nonpersistent_flags+=("--confirm")
    flags+=("--keep-tag-revisions=")
    local_nonpersistent_flags+=("--keep-tag-revisions=")
    flags+=("--keep-younger-than=")
    local_nonpersistent_flags+=("--keep-younger-than=")
    flags+=("--prune-over-size-limit")
    local_nonpersistent_flags+=("--prune-over-size-limit")
    flags+=("--registry-url=")
    local_nonpersistent_flags+=("--registry-url=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_prune()
{
    last_command="oadm_prune"
    commands=()
    commands+=("builds")
    commands+=("deployments")
    commands+=("groups")
    commands+=("images")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_registry()
{
    last_command="oadm_registry"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--create")
    local_nonpersistent_flags+=("--create")
    flags+=("--daemonset")
    local_nonpersistent_flags+=("--daemonset")
    flags+=("--dry-run")
    local_nonpersistent_flags+=("--dry-run")
    flags+=("--enforce-quota")
    local_nonpersistent_flags+=("--enforce-quota")
    flags+=("--images=")
    local_nonpersistent_flags+=("--images=")
    flags+=("--labels=")
    local_nonpersistent_flags+=("--labels=")
    flags+=("--latest-images")
    local_nonpersistent_flags+=("--latest-images")
    flags+=("--mount-host=")
    local_nonpersistent_flags+=("--mount-host=")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--ports=")
    local_nonpersistent_flags+=("--ports=")
    flags+=("--replicas=")
    local_nonpersistent_flags+=("--replicas=")
    flags+=("--selector=")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--service-account=")
    local_nonpersistent_flags+=("--service-account=")
    flags+=("--tls-certificate=")
    local_nonpersistent_flags+=("--tls-certificate=")
    flags+=("--tls-key=")
    local_nonpersistent_flags+=("--tls-key=")
    flags+=("--type=")
    local_nonpersistent_flags+=("--type=")
    flags+=("--volume=")
    local_nonpersistent_flags+=("--volume=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_router()
{
    last_command="oadm_router"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--create")
    local_nonpersistent_flags+=("--create")
    flags+=("--default-cert=")
    local_nonpersistent_flags+=("--default-cert=")
    flags+=("--disable-namespace-ownership-check")
    local_nonpersistent_flags+=("--disable-namespace-ownership-check")
    flags+=("--dry-run")
    local_nonpersistent_flags+=("--dry-run")
    flags+=("--expose-metrics")
    local_nonpersistent_flags+=("--expose-metrics")
    flags+=("--external-host=")
    local_nonpersistent_flags+=("--external-host=")
    flags+=("--external-host-http-vserver=")
    local_nonpersistent_flags+=("--external-host-http-vserver=")
    flags+=("--external-host-https-vserver=")
    local_nonpersistent_flags+=("--external-host-https-vserver=")
    flags+=("--external-host-insecure")
    local_nonpersistent_flags+=("--external-host-insecure")
    flags+=("--external-host-internal-ip=")
    local_nonpersistent_flags+=("--external-host-internal-ip=")
    flags+=("--external-host-partition-path=")
    local_nonpersistent_flags+=("--external-host-partition-path=")
    flags+=("--external-host-password=")
    local_nonpersistent_flags+=("--external-host-password=")
    flags+=("--external-host-private-key=")
    local_nonpersistent_flags+=("--external-host-private-key=")
    flags+=("--external-host-username=")
    local_nonpersistent_flags+=("--external-host-username=")
    flags+=("--external-host-vxlan-gw=")
    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
    flags+=("--force-subdomain=")
    local_nonpersistent_flags+=("--force-subdomain=")
    flags+=("--host-network")
    local_nonpersistent_flags+=("--host-network")
    flags+=("--host-ports")
    local_nonpersistent_flags+=("--host-ports")
    flags+=("--images=")
    local_nonpersistent_flags+=("--images=")
    flags+=("--labels=")
    local_nonpersistent_flags+=("--labels=")
    flags+=("--latest-images")
    local_nonpersistent_flags+=("--latest-images")
    flags+=("--metrics-image=")
    local_nonpersistent_flags+=("--metrics-image=")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--ports=")
    local_nonpersistent_flags+=("--ports=")
    flags+=("--replicas=")
    local_nonpersistent_flags+=("--replicas=")
    flags+=("--router-canonical-hostname=")
    local_nonpersistent_flags+=("--router-canonical-hostname=")
    flags+=("--secrets-as-env")
    local_nonpersistent_flags+=("--secrets-as-env")
    flags+=("--selector=")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--service-account=")
    local_nonpersistent_flags+=("--service-account=")
    flags+=("--stats-password=")
    local_nonpersistent_flags+=("--stats-password=")
    flags+=("--stats-port=")
    local_nonpersistent_flags+=("--stats-port=")
    flags+=("--stats-user=")
    local_nonpersistent_flags+=("--stats-user=")
    flags+=("--subdomain=")
    local_nonpersistent_flags+=("--subdomain=")
    flags+=("--type=")
    local_nonpersistent_flags+=("--type=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_taint()
{
    last_command="oadm_taint"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--all")
    local_nonpersistent_flags+=("--all")
    flags+=("--allow-missing-template-keys")
    local_nonpersistent_flags+=("--allow-missing-template-keys")
    flags+=("--no-headers")
    local_nonpersistent_flags+=("--no-headers")
    flags+=("--output=")
    two_word_flags+=("-o")
    local_nonpersistent_flags+=("--output=")
    flags+=("--output-version=")
    local_nonpersistent_flags+=("--output-version=")
    flags+=("--overwrite")
    local_nonpersistent_flags+=("--overwrite")
    flags+=("--schema-cache-dir=")
    flags_with_completion+=("--schema-cache-dir")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--schema-cache-dir=")
    flags+=("--selector=")
    two_word_flags+=("-l")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--show-all")
    flags+=("-a")
    local_nonpersistent_flags+=("--show-all")
    flags+=("--show-labels")
    local_nonpersistent_flags+=("--show-labels")
    flags+=("--sort-by=")
    local_nonpersistent_flags+=("--sort-by=")
    flags+=("--template=")
    flags_with_completion+=("--template")
    flags_completion+=("_filedir")
    local_nonpersistent_flags+=("--template=")
    flags+=("--validate")
    local_nonpersistent_flags+=("--validate")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    must_have_one_noun+=("node")
    noun_aliases=()
    noun_aliases+=("no")
    noun_aliases+=("nodes")
}

_oadm_top_images()
{
    last_command="oadm_top_images"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_top_imagestreams()
{
    last_command="oadm_top_imagestreams"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_top_node()
{
    last_command="oadm_top_node"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--heapster-namespace=")
    local_nonpersistent_flags+=("--heapster-namespace=")
    flags+=("--heapster-port=")
    local_nonpersistent_flags+=("--heapster-port=")
    flags+=("--heapster-scheme=")
    local_nonpersistent_flags+=("--heapster-scheme=")
    flags+=("--heapster-service=")
    local_nonpersistent_flags+=("--heapster-service=")
    flags+=("--selector=")
    two_word_flags+=("-l")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_top_pod()
{
    last_command="oadm_top_pod"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--all-namespaces")
    local_nonpersistent_flags+=("--all-namespaces")
    flags+=("--containers")
    local_nonpersistent_flags+=("--containers")
    flags+=("--heapster-namespace=")
    local_nonpersistent_flags+=("--heapster-namespace=")
    flags+=("--heapster-port=")
    local_nonpersistent_flags+=("--heapster-port=")
    flags+=("--heapster-scheme=")
    local_nonpersistent_flags+=("--heapster-scheme=")
    flags+=("--heapster-service=")
    local_nonpersistent_flags+=("--heapster-service=")
    flags+=("--selector=")
    two_word_flags+=("-l")
    local_nonpersistent_flags+=("--selector=")
    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_top()
{
    last_command="oadm_top"
    commands=()
    commands+=("images")
    commands+=("imagestreams")
    commands+=("node")
    commands+=("pod")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_uncordon()
{
    last_command="oadm_uncordon"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm_version()
{
    last_command="oadm_version"
    commands=()

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

_oadm()
{
    last_command="oadm"
    commands=()
    commands+=("build-chain")
    commands+=("ca")
    commands+=("certificate")
    commands+=("completion")
    commands+=("config")
    commands+=("cordon")
    commands+=("create-api-client-config")
    commands+=("create-bootstrap-policy-file")
    commands+=("create-bootstrap-project-template")
    commands+=("create-error-template")
    commands+=("create-kubeconfig")
    commands+=("create-login-template")
    commands+=("create-node-config")
    commands+=("create-provider-selection-template")
    commands+=("diagnostics")
    commands+=("drain")
    commands+=("groups")
    commands+=("ipfailover")
    commands+=("manage-node")
    commands+=("migrate")
    commands+=("new-project")
    commands+=("options")
    commands+=("overwrite-policy")
    commands+=("pod-network")
    commands+=("policy")
    commands+=("prune")
    commands+=("registry")
    commands+=("router")
    commands+=("taint")
    commands+=("top")
    commands+=("uncordon")
    commands+=("version")

    flags=()
    two_word_flags=()
    local_nonpersistent_flags=()
    flags_with_completion=()
    flags_completion=()

    flags+=("--as=")
    flags+=("--azure-container-registry-config=")
    flags+=("--certificate-authority=")
    flags_with_completion+=("--certificate-authority")
    flags_completion+=("_filedir")
    flags+=("--client-certificate=")
    flags_with_completion+=("--client-certificate")
    flags_completion+=("_filedir")
    flags+=("--client-key=")
    flags_with_completion+=("--client-key")
    flags_completion+=("_filedir")
    flags+=("--cluster=")
    flags+=("--config=")
    flags_with_completion+=("--config")
    flags_completion+=("_filedir")
    flags+=("--context=")
    flags+=("--google-json-key=")
    flags+=("--insecure-skip-tls-verify")
    flags+=("--log-flush-frequency=")
    flags+=("--loglevel=")
    flags+=("--logspec=")
    flags+=("--match-server-version")
    flags+=("--namespace=")
    two_word_flags+=("-n")
    flags+=("--request-timeout=")
    flags+=("--server=")
    flags+=("--token=")
    flags+=("--user=")

    must_have_one_flag=()
    must_have_one_noun=()
    noun_aliases=()
}

__start_oadm()
{
    local cur prev words cword
    declare -A flaghash 2>/dev/null || :
    if declare -F _init_completion >/dev/null 2>&1; then
        _init_completion -s || return
    else
        __my_init_completion -n "=" || return
    fi

    local c=0
    local flags=()
    local two_word_flags=()
    local local_nonpersistent_flags=()
    local flags_with_completion=()
    local flags_completion=()
    local commands=("oadm")
    local must_have_one_flag=()
    local must_have_one_noun=()
    local last_command
    local nouns=()

    __handle_word
}

if [[ $(type -t compopt) = "builtin" ]]; then
    complete -o default -F __start_oadm oadm
else
    complete -o default -o nospace -F __start_oadm oadm
fi

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

BASH_COMPLETION_EOF
}

__kubectl_bash_source <(__kubectl_convert_bash_to_zsh)
