#compdef surface

autoload -U is-at-least

_surface() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_surface_commands" \
"*::: :->surface" \
&& ret=0
    case $state in
    (surface)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-command-$line[1]:"
        case $line[1] in
            (dgpu)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_surface__dgpu_commands" \
"*::: :->dgpu" \
&& ret=0

    case $state in
    (dgpu)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-dgpu-command-$line[1]:"
        case $line[1] in
            (id)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get-power-state)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get-runtime-pm)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(set-runtime-pm)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':mode:((on\:"Enable runtime power management"
off\:"Disable runtime power management"))' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_surface__dgpu__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-dgpu-help-command-$line[1]:"
        case $line[1] in
            (id)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-power-state)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-runtime-pm)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-runtime-pm)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(dtx)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_surface__dtx_commands" \
"*::: :->dtx" \
&& ret=0

    case $state in
    (dtx)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-dtx-command-$line[1]:"
        case $line[1] in
            (lock)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(unlock)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(request)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(confirm)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(heartbeat)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(cancel)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get-base)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get-devicemode)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get-latchstatus)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(monitor)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_surface__dtx__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-dtx-help-command-$line[1]:"
        case $line[1] in
            (lock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(unlock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(request)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(confirm)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(heartbeat)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(cancel)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-base)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-devicemode)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-latchstatus)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(monitor)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(profile)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_surface__profile_commands" \
"*::: :->profile" \
&& ret=0

    case $state in
    (profile)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-profile-command-$line[1]:"
        case $line[1] in
            (set)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
':profile:_default' \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(next)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(prev)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_surface__profile__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-profile-help-command-$line[1]:"
        case $line[1] in
            (set)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(next)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(prev)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(status)
_arguments "${_arguments_options[@]}" : \
'-q[Keep output quiet]' \
'--quiet[Keep output quiet]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_surface__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-help-command-$line[1]:"
        case $line[1] in
            (dgpu)
_arguments "${_arguments_options[@]}" : \
":: :_surface__help__dgpu_commands" \
"*::: :->dgpu" \
&& ret=0

    case $state in
    (dgpu)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-help-dgpu-command-$line[1]:"
        case $line[1] in
            (id)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-power-state)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-runtime-pm)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-runtime-pm)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(dtx)
_arguments "${_arguments_options[@]}" : \
":: :_surface__help__dtx_commands" \
"*::: :->dtx" \
&& ret=0

    case $state in
    (dtx)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-help-dtx-command-$line[1]:"
        case $line[1] in
            (lock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(unlock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(request)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(confirm)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(heartbeat)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(cancel)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-base)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-devicemode)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-latchstatus)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(monitor)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(profile)
_arguments "${_arguments_options[@]}" : \
":: :_surface__help__profile_commands" \
"*::: :->profile" \
&& ret=0

    case $state in
    (profile)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:surface-help-profile-command-$line[1]:"
        case $line[1] in
            (set)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(next)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(prev)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(status)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_surface_commands] )) ||
_surface_commands() {
    local commands; commands=(
'dgpu:Control the discrete GPU' \
'dtx:Control the latch/dtx-system on the Surface Book 2' \
'profile:Control or query the current platform profile' \
'status:Show an overview of the current system status' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'surface commands' commands "$@"
}
(( $+functions[_surface__dgpu_commands] )) ||
_surface__dgpu_commands() {
    local commands; commands=(
'id:Get the dGPU PCI device ID' \
'get-power-state:Get the dGPU PCI power state' \
'get-runtime-pm:Get the dGPU runtime PM control' \
'set-runtime-pm:Set the dGPU runtime PM control' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'surface dgpu commands' commands "$@"
}
(( $+functions[_surface__dgpu__get-power-state_commands] )) ||
_surface__dgpu__get-power-state_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu get-power-state commands' commands "$@"
}
(( $+functions[_surface__dgpu__get-runtime-pm_commands] )) ||
_surface__dgpu__get-runtime-pm_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu get-runtime-pm commands' commands "$@"
}
(( $+functions[_surface__dgpu__help_commands] )) ||
_surface__dgpu__help_commands() {
    local commands; commands=(
'id:Get the dGPU PCI device ID' \
'get-power-state:Get the dGPU PCI power state' \
'get-runtime-pm:Get the dGPU runtime PM control' \
'set-runtime-pm:Set the dGPU runtime PM control' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'surface dgpu help commands' commands "$@"
}
(( $+functions[_surface__dgpu__help__get-power-state_commands] )) ||
_surface__dgpu__help__get-power-state_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu help get-power-state commands' commands "$@"
}
(( $+functions[_surface__dgpu__help__get-runtime-pm_commands] )) ||
_surface__dgpu__help__get-runtime-pm_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu help get-runtime-pm commands' commands "$@"
}
(( $+functions[_surface__dgpu__help__help_commands] )) ||
_surface__dgpu__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu help help commands' commands "$@"
}
(( $+functions[_surface__dgpu__help__id_commands] )) ||
_surface__dgpu__help__id_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu help id commands' commands "$@"
}
(( $+functions[_surface__dgpu__help__set-runtime-pm_commands] )) ||
_surface__dgpu__help__set-runtime-pm_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu help set-runtime-pm commands' commands "$@"
}
(( $+functions[_surface__dgpu__id_commands] )) ||
_surface__dgpu__id_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu id commands' commands "$@"
}
(( $+functions[_surface__dgpu__set-runtime-pm_commands] )) ||
_surface__dgpu__set-runtime-pm_commands() {
    local commands; commands=()
    _describe -t commands 'surface dgpu set-runtime-pm commands' commands "$@"
}
(( $+functions[_surface__dtx_commands] )) ||
_surface__dtx_commands() {
    local commands; commands=(
'lock:Lock the latch' \
'unlock:Unlock the latch' \
'request:Request latch-open or abort if already in progress' \
'confirm:Confirm latch-open if detachment in progress' \
'heartbeat:Send heartbeat if detachment in progress' \
'cancel:Cancel any detachment in progress' \
'get-base:Get information about the currently attached base' \
'get-devicemode:Query the current device operation mode' \
'get-latchstatus:Query the current latch status' \
'monitor:Monitor DTX events' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'surface dtx commands' commands "$@"
}
(( $+functions[_surface__dtx__cancel_commands] )) ||
_surface__dtx__cancel_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx cancel commands' commands "$@"
}
(( $+functions[_surface__dtx__confirm_commands] )) ||
_surface__dtx__confirm_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx confirm commands' commands "$@"
}
(( $+functions[_surface__dtx__get-base_commands] )) ||
_surface__dtx__get-base_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx get-base commands' commands "$@"
}
(( $+functions[_surface__dtx__get-devicemode_commands] )) ||
_surface__dtx__get-devicemode_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx get-devicemode commands' commands "$@"
}
(( $+functions[_surface__dtx__get-latchstatus_commands] )) ||
_surface__dtx__get-latchstatus_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx get-latchstatus commands' commands "$@"
}
(( $+functions[_surface__dtx__heartbeat_commands] )) ||
_surface__dtx__heartbeat_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx heartbeat commands' commands "$@"
}
(( $+functions[_surface__dtx__help_commands] )) ||
_surface__dtx__help_commands() {
    local commands; commands=(
'lock:Lock the latch' \
'unlock:Unlock the latch' \
'request:Request latch-open or abort if already in progress' \
'confirm:Confirm latch-open if detachment in progress' \
'heartbeat:Send heartbeat if detachment in progress' \
'cancel:Cancel any detachment in progress' \
'get-base:Get information about the currently attached base' \
'get-devicemode:Query the current device operation mode' \
'get-latchstatus:Query the current latch status' \
'monitor:Monitor DTX events' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'surface dtx help commands' commands "$@"
}
(( $+functions[_surface__dtx__help__cancel_commands] )) ||
_surface__dtx__help__cancel_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help cancel commands' commands "$@"
}
(( $+functions[_surface__dtx__help__confirm_commands] )) ||
_surface__dtx__help__confirm_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help confirm commands' commands "$@"
}
(( $+functions[_surface__dtx__help__get-base_commands] )) ||
_surface__dtx__help__get-base_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help get-base commands' commands "$@"
}
(( $+functions[_surface__dtx__help__get-devicemode_commands] )) ||
_surface__dtx__help__get-devicemode_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help get-devicemode commands' commands "$@"
}
(( $+functions[_surface__dtx__help__get-latchstatus_commands] )) ||
_surface__dtx__help__get-latchstatus_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help get-latchstatus commands' commands "$@"
}
(( $+functions[_surface__dtx__help__heartbeat_commands] )) ||
_surface__dtx__help__heartbeat_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help heartbeat commands' commands "$@"
}
(( $+functions[_surface__dtx__help__help_commands] )) ||
_surface__dtx__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help help commands' commands "$@"
}
(( $+functions[_surface__dtx__help__lock_commands] )) ||
_surface__dtx__help__lock_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help lock commands' commands "$@"
}
(( $+functions[_surface__dtx__help__monitor_commands] )) ||
_surface__dtx__help__monitor_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help monitor commands' commands "$@"
}
(( $+functions[_surface__dtx__help__request_commands] )) ||
_surface__dtx__help__request_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help request commands' commands "$@"
}
(( $+functions[_surface__dtx__help__unlock_commands] )) ||
_surface__dtx__help__unlock_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx help unlock commands' commands "$@"
}
(( $+functions[_surface__dtx__lock_commands] )) ||
_surface__dtx__lock_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx lock commands' commands "$@"
}
(( $+functions[_surface__dtx__monitor_commands] )) ||
_surface__dtx__monitor_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx monitor commands' commands "$@"
}
(( $+functions[_surface__dtx__request_commands] )) ||
_surface__dtx__request_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx request commands' commands "$@"
}
(( $+functions[_surface__dtx__unlock_commands] )) ||
_surface__dtx__unlock_commands() {
    local commands; commands=()
    _describe -t commands 'surface dtx unlock commands' commands "$@"
}
(( $+functions[_surface__help_commands] )) ||
_surface__help_commands() {
    local commands; commands=(
'dgpu:Control the discrete GPU' \
'dtx:Control the latch/dtx-system on the Surface Book 2' \
'profile:Control or query the current platform profile' \
'status:Show an overview of the current system status' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'surface help commands' commands "$@"
}
(( $+functions[_surface__help__dgpu_commands] )) ||
_surface__help__dgpu_commands() {
    local commands; commands=(
'id:Get the dGPU PCI device ID' \
'get-power-state:Get the dGPU PCI power state' \
'get-runtime-pm:Get the dGPU runtime PM control' \
'set-runtime-pm:Set the dGPU runtime PM control' \
    )
    _describe -t commands 'surface help dgpu commands' commands "$@"
}
(( $+functions[_surface__help__dgpu__get-power-state_commands] )) ||
_surface__help__dgpu__get-power-state_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dgpu get-power-state commands' commands "$@"
}
(( $+functions[_surface__help__dgpu__get-runtime-pm_commands] )) ||
_surface__help__dgpu__get-runtime-pm_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dgpu get-runtime-pm commands' commands "$@"
}
(( $+functions[_surface__help__dgpu__id_commands] )) ||
_surface__help__dgpu__id_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dgpu id commands' commands "$@"
}
(( $+functions[_surface__help__dgpu__set-runtime-pm_commands] )) ||
_surface__help__dgpu__set-runtime-pm_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dgpu set-runtime-pm commands' commands "$@"
}
(( $+functions[_surface__help__dtx_commands] )) ||
_surface__help__dtx_commands() {
    local commands; commands=(
'lock:Lock the latch' \
'unlock:Unlock the latch' \
'request:Request latch-open or abort if already in progress' \
'confirm:Confirm latch-open if detachment in progress' \
'heartbeat:Send heartbeat if detachment in progress' \
'cancel:Cancel any detachment in progress' \
'get-base:Get information about the currently attached base' \
'get-devicemode:Query the current device operation mode' \
'get-latchstatus:Query the current latch status' \
'monitor:Monitor DTX events' \
    )
    _describe -t commands 'surface help dtx commands' commands "$@"
}
(( $+functions[_surface__help__dtx__cancel_commands] )) ||
_surface__help__dtx__cancel_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx cancel commands' commands "$@"
}
(( $+functions[_surface__help__dtx__confirm_commands] )) ||
_surface__help__dtx__confirm_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx confirm commands' commands "$@"
}
(( $+functions[_surface__help__dtx__get-base_commands] )) ||
_surface__help__dtx__get-base_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx get-base commands' commands "$@"
}
(( $+functions[_surface__help__dtx__get-devicemode_commands] )) ||
_surface__help__dtx__get-devicemode_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx get-devicemode commands' commands "$@"
}
(( $+functions[_surface__help__dtx__get-latchstatus_commands] )) ||
_surface__help__dtx__get-latchstatus_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx get-latchstatus commands' commands "$@"
}
(( $+functions[_surface__help__dtx__heartbeat_commands] )) ||
_surface__help__dtx__heartbeat_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx heartbeat commands' commands "$@"
}
(( $+functions[_surface__help__dtx__lock_commands] )) ||
_surface__help__dtx__lock_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx lock commands' commands "$@"
}
(( $+functions[_surface__help__dtx__monitor_commands] )) ||
_surface__help__dtx__monitor_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx monitor commands' commands "$@"
}
(( $+functions[_surface__help__dtx__request_commands] )) ||
_surface__help__dtx__request_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx request commands' commands "$@"
}
(( $+functions[_surface__help__dtx__unlock_commands] )) ||
_surface__help__dtx__unlock_commands() {
    local commands; commands=()
    _describe -t commands 'surface help dtx unlock commands' commands "$@"
}
(( $+functions[_surface__help__help_commands] )) ||
_surface__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'surface help help commands' commands "$@"
}
(( $+functions[_surface__help__profile_commands] )) ||
_surface__help__profile_commands() {
    local commands; commands=(
'set:Set the current platform profile' \
'get:Get the current platform profile' \
'list:List all available platform profiles' \
'next:Cycle to the next platform profile' \
'prev:Cycle to the previous platform profile' \
    )
    _describe -t commands 'surface help profile commands' commands "$@"
}
(( $+functions[_surface__help__profile__get_commands] )) ||
_surface__help__profile__get_commands() {
    local commands; commands=()
    _describe -t commands 'surface help profile get commands' commands "$@"
}
(( $+functions[_surface__help__profile__list_commands] )) ||
_surface__help__profile__list_commands() {
    local commands; commands=()
    _describe -t commands 'surface help profile list commands' commands "$@"
}
(( $+functions[_surface__help__profile__next_commands] )) ||
_surface__help__profile__next_commands() {
    local commands; commands=()
    _describe -t commands 'surface help profile next commands' commands "$@"
}
(( $+functions[_surface__help__profile__prev_commands] )) ||
_surface__help__profile__prev_commands() {
    local commands; commands=()
    _describe -t commands 'surface help profile prev commands' commands "$@"
}
(( $+functions[_surface__help__profile__set_commands] )) ||
_surface__help__profile__set_commands() {
    local commands; commands=()
    _describe -t commands 'surface help profile set commands' commands "$@"
}
(( $+functions[_surface__help__status_commands] )) ||
_surface__help__status_commands() {
    local commands; commands=()
    _describe -t commands 'surface help status commands' commands "$@"
}
(( $+functions[_surface__profile_commands] )) ||
_surface__profile_commands() {
    local commands; commands=(
'set:Set the current platform profile' \
'get:Get the current platform profile' \
'list:List all available platform profiles' \
'next:Cycle to the next platform profile' \
'prev:Cycle to the previous platform profile' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'surface profile commands' commands "$@"
}
(( $+functions[_surface__profile__get_commands] )) ||
_surface__profile__get_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile get commands' commands "$@"
}
(( $+functions[_surface__profile__help_commands] )) ||
_surface__profile__help_commands() {
    local commands; commands=(
'set:Set the current platform profile' \
'get:Get the current platform profile' \
'list:List all available platform profiles' \
'next:Cycle to the next platform profile' \
'prev:Cycle to the previous platform profile' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'surface profile help commands' commands "$@"
}
(( $+functions[_surface__profile__help__get_commands] )) ||
_surface__profile__help__get_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile help get commands' commands "$@"
}
(( $+functions[_surface__profile__help__help_commands] )) ||
_surface__profile__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile help help commands' commands "$@"
}
(( $+functions[_surface__profile__help__list_commands] )) ||
_surface__profile__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile help list commands' commands "$@"
}
(( $+functions[_surface__profile__help__next_commands] )) ||
_surface__profile__help__next_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile help next commands' commands "$@"
}
(( $+functions[_surface__profile__help__prev_commands] )) ||
_surface__profile__help__prev_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile help prev commands' commands "$@"
}
(( $+functions[_surface__profile__help__set_commands] )) ||
_surface__profile__help__set_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile help set commands' commands "$@"
}
(( $+functions[_surface__profile__list_commands] )) ||
_surface__profile__list_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile list commands' commands "$@"
}
(( $+functions[_surface__profile__next_commands] )) ||
_surface__profile__next_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile next commands' commands "$@"
}
(( $+functions[_surface__profile__prev_commands] )) ||
_surface__profile__prev_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile prev commands' commands "$@"
}
(( $+functions[_surface__profile__set_commands] )) ||
_surface__profile__set_commands() {
    local commands; commands=()
    _describe -t commands 'surface profile set commands' commands "$@"
}
(( $+functions[_surface__status_commands] )) ||
_surface__status_commands() {
    local commands; commands=()
    _describe -t commands 'surface status commands' commands "$@"
}

if [ "$funcstack[1]" = "_surface" ]; then
    _surface "$@"
else
    compdef _surface surface
fi
