#compdef _sdb-toolbox-config sdb-toolbox-config


function _sdb-toolbox-config {
  local -a commands

  _arguments -C \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-h --help)'{-h,--help}'[Help for sdb-toolbox-config]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]' \
    "1: :->cmnds" \
    "*::arg:->args"

  case $state in
  cmnds)
    commands=(
      "describe-host:Display all properties of a host"
      "env:Display the Toolbox runtime environment"
      "help:Help about any command"
      "list-hosts:List registered hosts"
      "register-host:Register a host"
      "state:Display the Toolbox State File contents"
      "unregister-host:Unregister a host"
      "version:Display the Toolbox version"
    )
    _describe "command" commands
    ;;
  esac

  case "$words[1]" in
  describe-host)
    _sdb-toolbox-config_describe-host
    ;;
  env)
    _sdb-toolbox-config_env
    ;;
  help)
    _sdb-toolbox-config_help
    ;;
  list-hosts)
    _sdb-toolbox-config_list-hosts
    ;;
  register-host)
    _sdb-toolbox-config_register-host
    ;;
  state)
    _sdb-toolbox-config_state
    ;;
  unregister-host)
    _sdb-toolbox-config_unregister-host
    ;;
  version)
    _sdb-toolbox-config_version
    ;;
  esac
}

function _sdb-toolbox-config_describe-host {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for describe-host]' \
    '--host[The host to describe]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-toolbox-config_env {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for env]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-toolbox-config_help {
  _arguments \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-toolbox-config_list-hosts {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for list-hosts]' \
    '(-q --quiet)'{-q,--quiet}'[Only output hostnames]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-toolbox-config_register-host {
  _arguments \
    '--allow-duplicate-host-fingerprints[Whether to allow hosts with identical SSH host keys. (ADVANCED)]' \
    '--cluster-hostname[The cluster-addressable hostname for this host. Tools will use this value to configure intra-node communication. Specify the hostname without additional parameters (e.g., memsql-abc.domain instead of memsql-abc.domain:3306)]:' \
    '(-h --help)'{-h,--help}'[Help for register-host]' \
    '--host[SSH connection details for this host in the standard SSH \[username@\]hostname\[:port\] format. The hostname value will be used as the cluster-addressable hostname if '\''--cluster-hostname'\'' is not specified]:' \
    '(-i --identity-file)'{-i,--identity-file}'[The identity file for the host]:' \
    '--localhost[Whether this instance of Toolbox is located on the host]' \
    '--memsqlctl-config-path[The path to the memsqlctl.hcl file on the target host. (ADVANCED)]:' \
    '--memsqlctl-path[The path to the memsqlctl binary on the target host. (ADVANCED)]:' \
    '--skip-auto-config[Skip automatic operating system configuration]' \
    '--skip-validation[Skip validation of --memsqlctl-path and --memsqlctl-config-path]' \
    '--tar-install-dir[The directory to use for tar packages on the target host. (ADVANCED)]:' \
    '--tar-install-state[The path to the packages.hcl file on the target host. (ADVANCED)]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-toolbox-config_state {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for state]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-toolbox-config_unregister-host {
  _arguments \
    '(-a --all)'{-a,--all}'[Unregister all hosts]' \
    '(-h --help)'{-h,--help}'[Help for unregister-host]' \
    '--host[The host to unregister]:' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

function _sdb-toolbox-config_version {
  _arguments \
    '(-h --help)'{-h,--help}'[Help for version]' \
    '--backup-cache[File path for the backup cache]:' \
    '--cache-file[File path for the Toolbox node cache]:' \
    '(-c --config)'{-c,--config}'[File path for the Toolbox configuration]:' \
    '--disable-colors[Disable color output in console, which some terminal sessions/environments may have difficulty with]' \
    '--disable-spinner[Disable the progress spinner, which some terminal sessions/environments may have issues with]' \
    '(-j --json)'{-j,--json}'[Enable JSON output]' \
    '--parallelism[Maximum number of operations to run in parallel]:' \
    '--runtime-dir[Where to store Toolbox runtime data]:' \
    '--ssh-max-sessions[Maximum number of SSH sessions to open per host, must be at least 3]:' \
    '--ssh-strict-host-key-checking[Enable strict host key checking for SSH connections]' \
    '--ssh-user-known-hosts-file[Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used]:' \
    '--state-file[Toolbox state file path]:' \
    '(-v --verbosity)'{-v,--verbosity}'[Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count]' \
    '(-y --yes)'{-y,--yes}'[Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default]'
}

