#compdef tlpctl

# zsh completion for tlp
# GENERATED by `shtab` and EDITED

_shtab_tlpctl_commands() {
  local _commands=(
    "performance:Switch to performance profile"
    "balanced:Switch to balanced profile"
    "power-saver:Switch to power-saver profile"
    "get:Print the currently active power profile"
    "launch:Run a command using a specific power profile (hold)"
    "list:List available power profiles"
    "list-holds:List current power profile holds (from launch command)"
    "loglevel:Set the loglevel of the tlp-pd daemon"
    "set:Set the active power profile"
    "version:Print version info"
  )
  _describe 'tlpctl commands' _commands
}

_shtab_tlpctl_options=(
  "(-h --help)"{-h,--help}"[show this help message and exit]"
  "--version[Print version info]"
)

_shtab_tlpctl___version_options=(
)

_shtab_tlpctl_balanced_options=(
)

_shtab_tlpctl_get_options=(
)

_shtab_tlpctl_launch_options=(
  {--profile,-p}"[Profile that is kept in hold while the command is running]:profile:"
  {--reason,-r}"[Reason to be noted on the hold]:reason:"
  {--appid,-i}"[AppID to be noted on the hold]:appid:"
  "(*)::Command to launch:"
)

_shtab_tlpctl_list_options=(
)

_shtab_tlpctl_list_holds_options=(
)

_shtab_tlpctl_loglevel_options=(
  ":loglevel:(info debug)"
  ":loglevel:(info debug)"
)

_shtab_tlpctl_performance_options=(
)

_shtab_tlpctl_power_saver_options=(
)

_shtab_tlpctl_set_options=(
  ":Profile to activate:(performance balanced power-saver)"
  ":Profile to activate:(performance balanced power-saver)"
)

_shtab_tlpctl_version_options=(
)

_shtab_tlpctl() {
  local context state line curcontext="$curcontext" one_or_more='(-)*' remainder='(*)'

  if ((${_shtab_tlpctl_options[(I)${(q)one_or_more}*]} + ${_shtab_tlpctl_options[(I)${(q)remainder}*]} == 0)); then  # noqa: E501
    _shtab_tlpctl_options+=(': :_shtab_tlpctl_commands' '*::: :->tlpctl')
  fi
  _arguments -C -s $_shtab_tlpctl_options

  case $state in
    tlpctl)
      words=($line[1] "${words[@]}")
      (( CURRENT += 1 ))
      curcontext="${curcontext%:*:*}:_shtab_tlpctl-$line[1]:"
      case $line[1] in
        --version) _arguments -C -s $_shtab_tlpctl___version_options ;;
        balanced) _arguments -C -s $_shtab_tlpctl_balanced_options ;;
        get) _arguments -C -s $_shtab_tlpctl_get_options ;;
        launch) _arguments -C -s $_shtab_tlpctl_launch_options ;;
        list) _arguments -C -s $_shtab_tlpctl_list_options ;;
        list-holds) _arguments -C -s $_shtab_tlpctl_list_holds_options ;;
        loglevel) _arguments -C -s $_shtab_tlpctl_loglevel_options ;;
        performance) _arguments -C -s $_shtab_tlpctl_performance_options ;;
        power-saver) _arguments -C -s $_shtab_tlpctl_power_saver_options ;;
        set) _arguments -C -s $_shtab_tlpctl_set_options ;;
        version) _arguments -C -s $_shtab_tlpctl_version_options ;;
      esac
  esac
}

typeset -A opt_args

if [[ $zsh_eval_context[-1] == eval ]]; then
  # eval/source/. command, register function for later
  compdef _shtab_tlpctl -N tlpctl
else
  # autoload from fpath, call function directly
  _shtab_tlpctl "$@"
fi
