_stscli_options()
{
    local cur;

    prev=${COMP_WORDS[COMP_CWORD-1]}
    cur=${COMP_WORDS[COMP_CWORD]}

    case "$prev" in
      --profile | -p)
        COMPREPLY=( $(compgen -W '$(stscli list 2>/dev/null)' $cur) )
        ;;
      *)
        COMPREPLY=( $(compgen -W '--help --version --config --credentials --name --profile --region --role --serial_number --token_code get exec list' -- $cur) )
        ;;
    esac
}

complete -F _stscli_options stscli
