#compdef xprofile

_xprofile() {
    local curcontext="$curcontext" state line
    typeset -A opt_args

    _arguments '1: :->subcommand'


    case "$state" in
        subcommand)
            _arguments '1:Subcommands:(list current auto activate create -h --help --verbose --config --version)'
            ;;
        *)
            case $words[2] in
                activate)
                    compadd "$@" $(_call_program path xprofile list 2> /dev/null)
                    ;;
                auto)
                    compadd "$@" '--dry-run'
                    ;;
                create) =
                    compadd "$@" '--dry-run'
                    ;;
            esac
    esac
}

_xprofile "$@"
