#/bin/bash

_em_completions()
{
    if [ "${COMP_WORDS[1]}" == "boot" ]; then
        local suggestions=($(compgen -W "show vars kernel" -- "${COMP_WORDS[2]}"))
    elif [ "${COMP_WORDS[1]}" == "compliance" ]; then
        local suggestions=($(compgen -W "check report sync" -- "${COMP_WORDS[2]}"))
    elif [ "${#COMP_WORDS[@]}" != "2" ]; then
        return
    else
        local suggestions=($(compgen -W "logs help start  stop  status update vpn compliance version boot" -- "${COMP_WORDS[1]}"))
    fi
    COMPREPLY=("${suggestions[@]}")
}

complete -F _em_completions em
