#compdef powerprofilesctl

# AUTOMATICALLY GENERATED by https://github.com/tqdm/shtab
# Usage:
# 1) Copy this to a file named _powerprofilesctl (e.g. ~/.local/share/zsh_completion/_powerprofilesctl).
# 2) Add the following line to your .zshrc:
#    fpath=(~/.local/share/zsh_completion $fpath)
# See also: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org


_shtab_powerprofilesctl_commands() {
  local _commands=(
    configure-action:'Configure the action to be taken for the profile'
    configure-battery-aware:'Turn on or off dynamic changes from battery level or power adapter'
    get:'Print the currently active power profile'
    launch:'Launch the command while holding a power profile, either performance, or power-saver. By default, the profile hold is for the performance profile, but it might not be available on all systems. See the list command for a list of available profiles.'
    list:'List available power profiles'
    list-actions:'List available power profile actions'
    list-holds:'List current power profile holds'
    query-battery-aware:'Query if dynamic changes from battery level or power adapter are enabled'
    set:'Set the currently active power profile'
    version:'Print version information and exit'
  )
  _describe 'powerprofilesctl commands' _commands
}

_shtab_powerprofilesctl_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  "(- : *)--print-completion[print shell completion script]:print_completion:(bash zsh tcsh fish)"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_defaults_added=0

_shtab_powerprofilesctl_configure_action_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  "--enable[enable action]"
  "--disable[disable action]"
  ":action to change for configure-action:"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_configure_action_defaults_added=0

_shtab_powerprofilesctl_configure_battery_aware_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  "--enable[enable battery aware]"
  "--disable[disable battery aware]"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_configure_battery_aware_defaults_added=0

_shtab_powerprofilesctl_get_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_get_defaults_added=0

_shtab_powerprofilesctl_launch_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  {--profile,-p}"[Profile to use for launch command]:profile:"
  {--reason,-r}"[Reason to use for launch command]:reason:"
  {--appid,-i}"[AppId to use for launch command]:appid:"
  "(*)::Command to launch:"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_launch_defaults_added=0

_shtab_powerprofilesctl_list_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_list_defaults_added=0

_shtab_powerprofilesctl_list_actions_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_list_actions_defaults_added=0

_shtab_powerprofilesctl_list_holds_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_list_holds_defaults_added=0

_shtab_powerprofilesctl_query_battery_aware_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_query_battery_aware_defaults_added=0

_shtab_powerprofilesctl_set_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
  ":Profile to use for set command:"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_set_defaults_added=0

_shtab_powerprofilesctl_version_options=(
  "(- : *)"{-h,--help}"[show this help message and exit]"
)

# guard to ensure default positional specs are added only once per session
_shtab_powerprofilesctl_version_defaults_added=0


_shtab_powerprofilesctl() {
  local context state line curcontext="$curcontext" one_or_more='(*)' remainder='(-)*:' default='*::: :->powerprofilesctl'

  # Add default positional/remainder specs only if none exist, and only once per session
  if (( ! _shtab_powerprofilesctl_defaults_added )); then
    if (( ${_shtab_powerprofilesctl_options[(I)${(q)one_or_more}*]} +          ${_shtab_powerprofilesctl_options[(I)${(q)remainder}*]} +          ${_shtab_powerprofilesctl_options[(I)${(q)default}]} == 0 )); then
      _shtab_powerprofilesctl_options+=(': :_shtab_powerprofilesctl_commands' '*::: :->powerprofilesctl')
    fi
    _shtab_powerprofilesctl_defaults_added=1
  fi
  _arguments -C -s $_shtab_powerprofilesctl_options

  case $state in
    powerprofilesctl)
      words=($line[1] "${words[@]}")
      (( CURRENT += 1 ))
      curcontext="${curcontext%:*:*}:_shtab_powerprofilesctl-$line[1]:"
      case $line[1] in
        configure-action) _arguments -C -s $_shtab_powerprofilesctl_configure_action_options ;;
        configure-battery-aware) _arguments -C -s $_shtab_powerprofilesctl_configure_battery_aware_options ;;
        get) _arguments -C -s $_shtab_powerprofilesctl_get_options ;;
        launch) _arguments -C -s $_shtab_powerprofilesctl_launch_options ;;
        list) _arguments -C -s $_shtab_powerprofilesctl_list_options ;;
        list-actions) _arguments -C -s $_shtab_powerprofilesctl_list_actions_options ;;
        list-holds) _arguments -C -s $_shtab_powerprofilesctl_list_holds_options ;;
        query-battery-aware) _arguments -C -s $_shtab_powerprofilesctl_query_battery_aware_options ;;
        set) _arguments -C -s $_shtab_powerprofilesctl_set_options ;;
        version) _arguments -C -s $_shtab_powerprofilesctl_version_options ;;
      esac
  esac
}



typeset -A opt_args

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

