#!/usr/bin/env bash
#
# quarkus Bash Completion
# =======================
#
# Bash completion support for the `quarkus` command,
# generated by [picocli](https://picocli.info/) version 4.7.3-SNAPSHOT.
#
# Installation
# ------------
#
# 1. Source all completion scripts in your .bash_profile
#
#   cd $YOUR_APP_HOME/bin
#   for f in $(find . -name "*_completion"); do line=". $(pwd)/$f"; grep "$line" ~/.bash_profile || echo "$line" >> ~/.bash_profile; done
#
# 2. Open a new bash console, and type `quarkus [TAB][TAB]`
#
# 1a. Alternatively, if you have [bash-completion](https://github.com/scop/bash-completion) installed:
#     Place this file in a `bash-completion.d` folder:
#
#   * /etc/bash-completion.d
#   * /usr/local/etc/bash-completion.d
#   * ~/bash-completion.d
#
# Documentation
# -------------
# The script is called by bash whenever [TAB] or [TAB][TAB] is pressed after
# 'quarkus (..)'. By reading entered command line parameters,
# it determines possible bash completions and writes them to the COMPREPLY variable.
# Bash then completes the user input if only one entry is listed in the variable or
# shows the options if more than one is listed in COMPREPLY.
#
# References
# ----------
# [1] http://stackoverflow.com/a/12495480/1440785
# [2] http://tiswww.case.edu/php/chet/bash/FAQ
# [3] https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html
# [4] http://zsh.sourceforge.net/Doc/Release/Options.html#index-COMPLETE_005fALIASES
# [5] https://stackoverflow.com/questions/17042057/bash-check-element-in-array-for-elements-in-another-array/17042655#17042655
# [6] https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html#Programmable-Completion
# [7] https://stackoverflow.com/questions/3249432/can-a-bash-tab-completion-script-be-used-in-zsh/27853970#27853970
#

if [ -n "$BASH_VERSION" ]; then
  # Enable programmable completion facilities when using bash (see [3])
  shopt -s progcomp
elif [ -n "$ZSH_VERSION" ]; then
  # Make alias a distinct command for completion purposes when using zsh (see [4])
  setopt COMPLETE_ALIASES
  alias compopt=complete

  # Enable bash completion in zsh (see [7])
  # Only initialize completions module once to avoid unregistering existing completions.
  if ! type compdef > /dev/null; then
    autoload -U +X compinit && compinit
  fi
  autoload -U +X bashcompinit && bashcompinit
fi

# CompWordsContainsArray takes an array and then checks
# if all elements of this array are in the global COMP_WORDS array.
#
# Returns zero (no error) if all elements of the array are in the COMP_WORDS array,
# otherwise returns 1 (error).
function CompWordsContainsArray() {
  declare -a localArray
  localArray=("$@")
  local findme
  for findme in "${localArray[@]}"; do
    if ElementNotInCompWords "$findme"; then return 1; fi
  done
  return 0
}
function ElementNotInCompWords() {
  local findme="$1"
  local element
  for element in "${COMP_WORDS[@]}"; do
    if [[ "$findme" = "$element" ]]; then return 1; fi
  done
  return 0
}

# The `currentPositionalIndex` function calculates the index of the current positional parameter.
#
# currentPositionalIndex takes three parameters:
# the command name,
# a space-separated string with the names of options that take a parameter, and
# a space-separated string with the names of boolean options (that don't take any params).
# When done, this function echos the current positional index to std_out.
#
# Example usage:
# local currIndex=$(currentPositionalIndex "mysubcommand" "$ARG_OPTS" "$FLAG_OPTS")
function currentPositionalIndex() {
  local commandName="$1"
  local optionsWithArgs="$2"
  local booleanOptions="$3"
  local previousWord
  local result=0

  for i in $(seq $((COMP_CWORD - 1)) -1 0); do
    previousWord=${COMP_WORDS[i]}
    if [ "${previousWord}" = "$commandName" ]; then
      break
    fi
    if [[ "${optionsWithArgs}" =~ ${previousWord} ]]; then
      ((result-=2)) # Arg option and its value not counted as positional param
    elif [[ "${booleanOptions}" =~ ${previousWord} ]]; then
      ((result-=1)) # Flag option itself not counted as positional param
    fi
    ((result++))
  done
  echo "$result"
}

# compReplyArray generates a list of completion suggestions based on an array, ensuring all values are properly escaped.
#
# compReplyArray takes a single parameter: the array of options to be displayed
#
# The output is echoed to std_out, one option per line.
#
# Example usage:
# local options=("foo", "bar", "baz")
# local IFS=$'\n'
# COMPREPLY=($(compReplyArray "${options[@]}"))
function compReplyArray() {
  declare -a options
  options=("$@")
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local i
  local quoted
  local optionList=()

  for (( i=0; i<${#options[@]}; i++ )); do
    # Double escape, since we want escaped values, but compgen -W expands the argument
    printf -v quoted %q "${options[i]}"
    quoted=\'${quoted//\'/\'\\\'\'}\'

    optionList[i]=$quoted
  done

  # We also have to add another round of escaping to $curr_word.
  curr_word=${curr_word//\\/\\\\}
  curr_word=${curr_word//\'/\\\'}

  # Actually generate completions.
  local IFS=$'\n'
  echo -e "$(compgen -W "${optionList[*]}" -- "$curr_word")"
}

# Bash completion entry point function.
# _complete_quarkus finds which commands and subcommands have been specified
# on the command line and delegates to the appropriate function
# to generate possible options and subcommands for the last specified subcommand.
function _complete_quarkus() {
  # Edge case: if command line has no space after subcommand, then don't assume this subcommand is selected (remkop/picocli#1468).
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} create" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} build" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} dev" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} test" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} extension" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} ext" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} image" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} deploy" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} registry" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} info" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} update" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} up" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} upgrade" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plugin" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plug" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} completion" ];    then _picocli_quarkus; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} create app" ];    then _picocli_quarkus_create; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} create cli" ];    then _picocli_quarkus_create; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} create extension" ];    then _picocli_quarkus_create; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} extension list" ];    then _picocli_quarkus_extension; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} extension ls" ];    then _picocli_quarkus_extension; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} extension categories" ];    then _picocli_quarkus_extension; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} extension cat" ];    then _picocli_quarkus_extension; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} extension add" ];    then _picocli_quarkus_extension; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} extension remove" ];    then _picocli_quarkus_extension; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} extension rm" ];    then _picocli_quarkus_extension; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} ext list" ];    then _picocli_quarkus_ext; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} ext ls" ];    then _picocli_quarkus_ext; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} ext categories" ];    then _picocli_quarkus_ext; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} ext cat" ];    then _picocli_quarkus_ext; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} ext add" ];    then _picocli_quarkus_ext; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} ext remove" ];    then _picocli_quarkus_ext; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} ext rm" ];    then _picocli_quarkus_ext; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} image build" ];    then _picocli_quarkus_image; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} image push" ];    then _picocli_quarkus_image; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} image build docker" ];    then _picocli_quarkus_image_build; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} image build buildpack" ];    then _picocli_quarkus_image_build; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} image build jib" ];    then _picocli_quarkus_image_build; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} image build openshift" ];    then _picocli_quarkus_image_build; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} deploy kubernetes" ];    then _picocli_quarkus_deploy; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} deploy openshift" ];    then _picocli_quarkus_deploy; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} deploy knative" ];    then _picocli_quarkus_deploy; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} deploy kind" ];    then _picocli_quarkus_deploy; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} deploy minikube" ];    then _picocli_quarkus_deploy; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} registry list" ];    then _picocli_quarkus_registry; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} registry add" ];    then _picocli_quarkus_registry; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} registry remove" ];    then _picocli_quarkus_registry; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plugin list" ];    then _picocli_quarkus_plugin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plugin ls" ];    then _picocli_quarkus_plugin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plugin add" ];    then _picocli_quarkus_plugin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plugin remove" ];    then _picocli_quarkus_plugin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plugin sync" ];    then _picocli_quarkus_plugin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plug list" ];    then _picocli_quarkus_plug; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plug ls" ];    then _picocli_quarkus_plug; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plug add" ];    then _picocli_quarkus_plug; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plug remove" ];    then _picocli_quarkus_plug; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} plug sync" ];    then _picocli_quarkus_plug; return $?; fi

  # Find the longest sequence of subcommands and call the bash function for that subcommand.
  local cmds0=(create)
  local cmds1=(build)
  local cmds2=(dev)
  local cmds3=(test)
  local cmds4=(extension)
  local cmds5=(ext)
  local cmds6=(image)
  local cmds7=(deploy)
  local cmds8=(registry)
  local cmds9=(info)
  local cmds10=(update)
  local cmds11=(up)
  local cmds12=(upgrade)
  local cmds13=(plugin)
  local cmds14=(plug)
  local cmds15=(completion)
  local cmds16=(create app)
  local cmds17=(create cli)
  local cmds18=(create extension)
  local cmds19=(extension list)
  local cmds20=(extension ls)
  local cmds21=(extension categories)
  local cmds22=(extension cat)
  local cmds23=(extension add)
  local cmds24=(extension remove)
  local cmds25=(extension rm)
  local cmds26=(ext list)
  local cmds27=(ext ls)
  local cmds28=(ext categories)
  local cmds29=(ext cat)
  local cmds30=(ext add)
  local cmds31=(ext remove)
  local cmds32=(ext rm)
  local cmds33=(image build)
  local cmds34=(image push)
  local cmds35=(image build docker)
  local cmds36=(image build buildpack)
  local cmds37=(image build jib)
  local cmds38=(image build openshift)
  local cmds39=(deploy kubernetes)
  local cmds40=(deploy openshift)
  local cmds41=(deploy knative)
  local cmds42=(deploy kind)
  local cmds43=(deploy minikube)
  local cmds44=(registry list)
  local cmds45=(registry add)
  local cmds46=(registry remove)
  local cmds47=(plugin list)
  local cmds48=(plugin ls)
  local cmds49=(plugin add)
  local cmds50=(plugin remove)
  local cmds51=(plugin sync)
  local cmds52=(plug list)
  local cmds53=(plug ls)
  local cmds54=(plug add)
  local cmds55=(plug remove)
  local cmds56=(plug sync)

  if CompWordsContainsArray "${cmds56[@]}"; then _picocli_quarkus_plug_sync; return $?; fi
  if CompWordsContainsArray "${cmds55[@]}"; then _picocli_quarkus_plug_remove; return $?; fi
  if CompWordsContainsArray "${cmds54[@]}"; then _picocli_quarkus_plug_add; return $?; fi
  if CompWordsContainsArray "${cmds53[@]}"; then _picocli_quarkus_plug_ls; return $?; fi
  if CompWordsContainsArray "${cmds52[@]}"; then _picocli_quarkus_plug_list; return $?; fi
  if CompWordsContainsArray "${cmds51[@]}"; then _picocli_quarkus_plugin_sync; return $?; fi
  if CompWordsContainsArray "${cmds50[@]}"; then _picocli_quarkus_plugin_remove; return $?; fi
  if CompWordsContainsArray "${cmds49[@]}"; then _picocli_quarkus_plugin_add; return $?; fi
  if CompWordsContainsArray "${cmds48[@]}"; then _picocli_quarkus_plugin_ls; return $?; fi
  if CompWordsContainsArray "${cmds47[@]}"; then _picocli_quarkus_plugin_list; return $?; fi
  if CompWordsContainsArray "${cmds46[@]}"; then _picocli_quarkus_registry_remove; return $?; fi
  if CompWordsContainsArray "${cmds45[@]}"; then _picocli_quarkus_registry_add; return $?; fi
  if CompWordsContainsArray "${cmds44[@]}"; then _picocli_quarkus_registry_list; return $?; fi
  if CompWordsContainsArray "${cmds43[@]}"; then _picocli_quarkus_deploy_minikube; return $?; fi
  if CompWordsContainsArray "${cmds42[@]}"; then _picocli_quarkus_deploy_kind; return $?; fi
  if CompWordsContainsArray "${cmds41[@]}"; then _picocli_quarkus_deploy_knative; return $?; fi
  if CompWordsContainsArray "${cmds40[@]}"; then _picocli_quarkus_deploy_openshift; return $?; fi
  if CompWordsContainsArray "${cmds39[@]}"; then _picocli_quarkus_deploy_kubernetes; return $?; fi
  if CompWordsContainsArray "${cmds38[@]}"; then _picocli_quarkus_image_build_openshift; return $?; fi
  if CompWordsContainsArray "${cmds37[@]}"; then _picocli_quarkus_image_build_jib; return $?; fi
  if CompWordsContainsArray "${cmds36[@]}"; then _picocli_quarkus_image_build_buildpack; return $?; fi
  if CompWordsContainsArray "${cmds35[@]}"; then _picocli_quarkus_image_build_docker; return $?; fi
  if CompWordsContainsArray "${cmds34[@]}"; then _picocli_quarkus_image_push; return $?; fi
  if CompWordsContainsArray "${cmds33[@]}"; then _picocli_quarkus_image_build; return $?; fi
  if CompWordsContainsArray "${cmds32[@]}"; then _picocli_quarkus_ext_rm; return $?; fi
  if CompWordsContainsArray "${cmds31[@]}"; then _picocli_quarkus_ext_remove; return $?; fi
  if CompWordsContainsArray "${cmds30[@]}"; then _picocli_quarkus_ext_add; return $?; fi
  if CompWordsContainsArray "${cmds29[@]}"; then _picocli_quarkus_ext_cat; return $?; fi
  if CompWordsContainsArray "${cmds28[@]}"; then _picocli_quarkus_ext_categories; return $?; fi
  if CompWordsContainsArray "${cmds27[@]}"; then _picocli_quarkus_ext_ls; return $?; fi
  if CompWordsContainsArray "${cmds26[@]}"; then _picocli_quarkus_ext_list; return $?; fi
  if CompWordsContainsArray "${cmds25[@]}"; then _picocli_quarkus_extension_rm; return $?; fi
  if CompWordsContainsArray "${cmds24[@]}"; then _picocli_quarkus_extension_remove; return $?; fi
  if CompWordsContainsArray "${cmds23[@]}"; then _picocli_quarkus_extension_add; return $?; fi
  if CompWordsContainsArray "${cmds22[@]}"; then _picocli_quarkus_extension_cat; return $?; fi
  if CompWordsContainsArray "${cmds21[@]}"; then _picocli_quarkus_extension_categories; return $?; fi
  if CompWordsContainsArray "${cmds20[@]}"; then _picocli_quarkus_extension_ls; return $?; fi
  if CompWordsContainsArray "${cmds19[@]}"; then _picocli_quarkus_extension_list; return $?; fi
  if CompWordsContainsArray "${cmds18[@]}"; then _picocli_quarkus_create_extension; return $?; fi
  if CompWordsContainsArray "${cmds17[@]}"; then _picocli_quarkus_create_cli; return $?; fi
  if CompWordsContainsArray "${cmds16[@]}"; then _picocli_quarkus_create_app; return $?; fi
  if CompWordsContainsArray "${cmds15[@]}"; then _picocli_quarkus_completion; return $?; fi
  if CompWordsContainsArray "${cmds14[@]}"; then _picocli_quarkus_plug; return $?; fi
  if CompWordsContainsArray "${cmds13[@]}"; then _picocli_quarkus_plugin; return $?; fi
  if CompWordsContainsArray "${cmds12[@]}"; then _picocli_quarkus_upgrade; return $?; fi
  if CompWordsContainsArray "${cmds11[@]}"; then _picocli_quarkus_up; return $?; fi
  if CompWordsContainsArray "${cmds10[@]}"; then _picocli_quarkus_update; return $?; fi
  if CompWordsContainsArray "${cmds9[@]}"; then _picocli_quarkus_info; return $?; fi
  if CompWordsContainsArray "${cmds8[@]}"; then _picocli_quarkus_registry; return $?; fi
  if CompWordsContainsArray "${cmds7[@]}"; then _picocli_quarkus_deploy; return $?; fi
  if CompWordsContainsArray "${cmds6[@]}"; then _picocli_quarkus_image; return $?; fi
  if CompWordsContainsArray "${cmds5[@]}"; then _picocli_quarkus_ext; return $?; fi
  if CompWordsContainsArray "${cmds4[@]}"; then _picocli_quarkus_extension; return $?; fi
  if CompWordsContainsArray "${cmds3[@]}"; then _picocli_quarkus_test; return $?; fi
  if CompWordsContainsArray "${cmds2[@]}"; then _picocli_quarkus_dev; return $?; fi
  if CompWordsContainsArray "${cmds1[@]}"; then _picocli_quarkus_build; return $?; fi
  if CompWordsContainsArray "${cmds0[@]}"; then _picocli_quarkus_create; return $?; fi

  # No subcommands were specified; generate completions for the top-level command.
  _picocli_quarkus; return $?;
}

# Generates completions for the options and subcommands of the `quarkus` command.
function _picocli_quarkus() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="create build dev test extension ext image deploy registry info update up upgrade plugin plug completion"
  local flag_opts="--refresh -h --help -v --version -e --errors --verbose"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `create` subcommand.
function _picocli_quarkus_create() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="app cli extension"
  local flag_opts="-e --errors --verbose -h --help"
  local arg_opts=""

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `build` subcommand.
function _picocli_quarkus_build() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `dev` subcommand.
function _picocli_quarkus_dev() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --dry-run --clean --offline --no-debug --suspend"
  local arg_opts="--config -D --debug-host --debug-mode --debug-port"
  local mode_option_args=("connect" "listen") # --debug-mode values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --debug-host)
      return
      ;;
    --debug-mode)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${mode_option_args[@]}" ) )
      return $?
      ;;
    --debug-port)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `test` subcommand.
function _picocli_quarkus_test() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --dry-run --clean --offline --no-debug --suspend"
  local arg_opts="--config -D --debug-host --debug-mode --debug-port"
  local mode_option_args=("connect" "listen") # --debug-mode values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --debug-host)
      return
      ;;
    --debug-mode)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${mode_option_args[@]}" ) )
      return $?
      ;;
    --debug-port)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `extension` subcommand.
function _picocli_quarkus_extension() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="list ls categories cat add remove rm"
  local flag_opts="-e --errors --verbose"
  local arg_opts=""

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `ext` subcommand.
function _picocli_quarkus_ext() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="list ls categories cat add remove rm"
  local flag_opts="-e --errors --verbose"
  local arg_opts=""

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `image` subcommand.
function _picocli_quarkus_image() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="build push"
  local flag_opts="-e --errors --verbose -h --help"
  local arg_opts=""

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `deploy` subcommand.
function _picocli_quarkus_deploy() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="kubernetes openshift knative kind minikube"
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `registry` subcommand.
function _picocli_quarkus_registry() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="list add remove"
  local flag_opts="-e --errors --verbose -h --help"
  local arg_opts=""

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `info` subcommand.
function _picocli_quarkus_info() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --per-module"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `update` subcommand.
function _picocli_quarkus_update() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --no-rewrite --dry-run --per-module"
  local arg_opts="--config -D -S --stream -P --platform-version --update-recipes-version --rewrite-plugin-version"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-version)
      return
      ;;
    --update-recipes-version)
      return
      ;;
    --rewrite-plugin-version)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `up` subcommand.
function _picocli_quarkus_up() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --no-rewrite --dry-run --per-module"
  local arg_opts="--config -D -S --stream -P --platform-version --update-recipes-version --rewrite-plugin-version"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-version)
      return
      ;;
    --update-recipes-version)
      return
      ;;
    --rewrite-plugin-version)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `upgrade` subcommand.
function _picocli_quarkus_upgrade() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --no-rewrite --dry-run --per-module"
  local arg_opts="--config -D -S --stream -P --platform-version --update-recipes-version --rewrite-plugin-version"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-version)
      return
      ;;
    --update-recipes-version)
      return
      ;;
    --rewrite-plugin-version)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `plugin` subcommand.
function _picocli_quarkus_plugin() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="list ls add remove sync"
  local flag_opts="-e --errors --verbose"
  local arg_opts=""

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `plug` subcommand.
function _picocli_quarkus_plug() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="list ls add remove sync"
  local flag_opts="-e --errors --verbose"
  local arg_opts=""

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `completion` subcommand.
function _picocli_quarkus_completion() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands=""
  local flag_opts="-h --help -V --version"
  local arg_opts=""

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `app` subcommand.
function _picocli_quarkus_create_app() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-B --batch-mode --dry-run -e --errors --verbose --refresh --registry-client -h --help --jbang --maven --gradle --gradle-kotlin-dsl --kotlin --scala --no-wrapper --no-code"
  local arg_opts="--config -o --output-directory -x --extension --extensions --name --description -S --stream -P --platform-bom --java --package-name -c --app-config --data -D"
  local javaVersion_option_args=("11" "17") # --java values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -o|--output-directory)
      return
      ;;
    -x|--extension|--extensions)
      return
      ;;
    --name)
      return
      ;;
    --description)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --java)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${javaVersion_option_args[@]}" ) )
      return $?
      ;;
    --package-name)
      return
      ;;
    -c|--app-config)
      return
      ;;
    --data)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `cli` subcommand.
function _picocli_quarkus_create_cli() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-B --batch-mode --dry-run -e --errors --verbose --refresh --registry-client -h --help --jbang --maven --gradle --gradle-kotlin-dsl --kotlin --scala --no-wrapper --no-code"
  local arg_opts="--config -o --output-directory -x --extension --extensions --name --description -S --stream -P --platform-bom --java --package-name -c --app-config --data -D"
  local javaVersion_option_args=("11" "17") # --java values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -o|--output-directory)
      return
      ;;
    -x|--extension|--extensions)
      return
      ;;
    --name)
      return
      ;;
    --description)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --java)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${javaVersion_option_args[@]}" ) )
      return $?
      ;;
    --package-name)
      return
      ;;
    -c|--app-config)
      return
      ;;
    --data)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `extension` subcommand.
function _picocli_quarkus_create_extension() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-B --batch-mode --dry-run -e --errors --verbose --refresh --registry-client -h --help -C --codestart --no-unit-test --no-it-test --no-devmode-test"
  local arg_opts="--config -o --output-directory -S --stream -P --platform-bom -N --namespace-id --extension-name --extension-description --namespace-name --package-name --without-tests -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -o|--output-directory)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    -N|--namespace-id)
      return
      ;;
    --extension-name)
      return
      ;;
    --extension-description)
      return
      ;;
    --namespace-name)
      return
      ;;
    --package-name)
      return
      ;;
    --without-tests)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `list` subcommand.
function _picocli_quarkus_extension_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run -i --installable --id --concise --full --origins"
  local arg_opts="--config -D -S --stream -P --platform-bom -s --search -c --category"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    -s|--search)
      return
      ;;
    -c|--category)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `ls` subcommand.
function _picocli_quarkus_extension_ls() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run -i --installable --id --concise --full --origins"
  local arg_opts="--config -D -S --stream -P --platform-bom -s --search -c --category"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    -s|--search)
      return
      ;;
    -c|--category)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `categories` subcommand.
function _picocli_quarkus_extension_categories() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --id --concise --full"
  local arg_opts="--config -D -S --stream -P --platform-bom"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `cat` subcommand.
function _picocli_quarkus_extension_cat() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --id --concise --full"
  local arg_opts="--config -D -S --stream -P --platform-bom"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `add` subcommand.
function _picocli_quarkus_extension_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `remove` subcommand.
function _picocli_quarkus_extension_remove() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `rm` subcommand.
function _picocli_quarkus_extension_rm() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `list` subcommand.
function _picocli_quarkus_ext_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run -i --installable --id --concise --full --origins"
  local arg_opts="--config -D -S --stream -P --platform-bom -s --search -c --category"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    -s|--search)
      return
      ;;
    -c|--category)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `ls` subcommand.
function _picocli_quarkus_ext_ls() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run -i --installable --id --concise --full --origins"
  local arg_opts="--config -D -S --stream -P --platform-bom -s --search -c --category"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    -s|--search)
      return
      ;;
    -c|--category)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `categories` subcommand.
function _picocli_quarkus_ext_categories() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --id --concise --full"
  local arg_opts="--config -D -S --stream -P --platform-bom"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `cat` subcommand.
function _picocli_quarkus_ext_cat() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --id --concise --full"
  local arg_opts="--config -D -S --stream -P --platform-bom"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `add` subcommand.
function _picocli_quarkus_ext_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `remove` subcommand.
function _picocli_quarkus_ext_remove() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `rm` subcommand.
function _picocli_quarkus_ext_rm() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run"
  local arg_opts="--config -D"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `build` subcommand.
function _picocli_quarkus_image_build() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="docker buildpack jib openshift"
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests"
  local arg_opts="--config -D --group --name --tag --registry"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --group)
      return
      ;;
    --name)
      return
      ;;
    --tag)
      return
      ;;
    --registry)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `push` subcommand.
function _picocli_quarkus_image_push() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests --registry-password-stdin --also-build"
  local arg_opts="--config -D --group --name --tag --registry --registry-username --registry-password"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --group)
      return
      ;;
    --name)
      return
      ;;
    --tag)
      return
      ;;
    --registry)
      return
      ;;
    --registry-username)
      return
      ;;
    --registry-password)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `docker` subcommand.
function _picocli_quarkus_image_build_docker() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests"
  local arg_opts="--config -D --group --name --tag --registry --dockerfile"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --group)
      return
      ;;
    --name)
      return
      ;;
    --tag)
      return
      ;;
    --registry)
      return
      ;;
    --dockerfile)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `buildpack` subcommand.
function _picocli_quarkus_image_build_buildpack() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests"
  local arg_opts="--config -D --group --name --tag --registry --builder-image --builder-registry-username --builder-registry-password --pull-image-timeout --run-image --docker-host --build-env"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --group)
      return
      ;;
    --name)
      return
      ;;
    --tag)
      return
      ;;
    --registry)
      return
      ;;
    --builder-image)
      return
      ;;
    --builder-registry-username)
      return
      ;;
    --builder-registry-password)
      return
      ;;
    --pull-image-timeout)
      return
      ;;
    --run-image)
      return
      ;;
    --docker-host)
      return
      ;;
    --build-env)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `jib` subcommand.
function _picocli_quarkus_image_build_jib() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests --always-cache-base-image"
  local arg_opts="--config -D --group --name --tag --registry --base-image --arg --entrypoint --env --label --port --user --platform --image-digest-file --image-id-file"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --group)
      return
      ;;
    --name)
      return
      ;;
    --tag)
      return
      ;;
    --registry)
      return
      ;;
    --base-image)
      return
      ;;
    --arg)
      return
      ;;
    --entrypoint)
      return
      ;;
    --env)
      return
      ;;
    --label)
      return
      ;;
    --port)
      return
      ;;
    --user)
      return
      ;;
    --platform)
      return
      ;;
    --image-digest-file)
      return
      ;;
    --image-id-file)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `openshift` subcommand.
function _picocli_quarkus_image_build_openshift() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests"
  local arg_opts="--config -D --group --name --tag --registry --build-strategy --base-image --arg --dockerfile --artifact-directory --artifact-filename --build-timeout"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --group)
      return
      ;;
    --name)
      return
      ;;
    --tag)
      return
      ;;
    --registry)
      return
      ;;
    --build-strategy)
      return
      ;;
    --base-image)
      return
      ;;
    --arg)
      return
      ;;
    --dockerfile)
      return
      ;;
    --artifact-directory)
      return
      ;;
    --artifact-filename)
      return
      ;;
    --build-timeout)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `kubernetes` subcommand.
function _picocli_quarkus_deploy_kubernetes() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests --image-build"
  local arg_opts="--config -D --api-server-url --username --password --token --trust-certs --namespace --ca-cert-file --ca-cert-data --client-cert-file --client-cert-data --client-key-file --client-key-data --client-key-algo --client-key-passphrase --http-proxy --https-proxy --proxy-username --proxy-password --no-proxy --image-builder --deployment-kind"
  local kind_option_args=("Deployment" "StatefulSet" "Job") # --deployment-kind values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --api-server-url)
      return
      ;;
    --username)
      return
      ;;
    --password)
      return
      ;;
    --token)
      return
      ;;
    --trust-certs)
      return
      ;;
    --namespace)
      return
      ;;
    --ca-cert-file)
      return
      ;;
    --ca-cert-data)
      return
      ;;
    --client-cert-file)
      return
      ;;
    --client-cert-data)
      return
      ;;
    --client-key-file)
      return
      ;;
    --client-key-data)
      return
      ;;
    --client-key-algo)
      return
      ;;
    --client-key-passphrase)
      return
      ;;
    --http-proxy)
      return
      ;;
    --https-proxy)
      return
      ;;
    --proxy-username)
      return
      ;;
    --proxy-password)
      return
      ;;
    --no-proxy)
      return
      ;;
    --image-builder)
      return
      ;;
    --deployment-kind)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${kind_option_args[@]}" ) )
      return $?
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `openshift` subcommand.
function _picocli_quarkus_deploy_openshift() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests --image-build"
  local arg_opts="--config -D --api-server-url --username --password --token --trust-certs --namespace --ca-cert-file --ca-cert-data --client-cert-file --client-cert-data --client-key-file --client-key-data --client-key-algo --client-key-passphrase --http-proxy --https-proxy --proxy-username --proxy-password --no-proxy --image-builder --deployment-kind"
  local kind_option_args=("Deployment" "DeploymentConfig" "StatefulSet" "Job") # --deployment-kind values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --api-server-url)
      return
      ;;
    --username)
      return
      ;;
    --password)
      return
      ;;
    --token)
      return
      ;;
    --trust-certs)
      return
      ;;
    --namespace)
      return
      ;;
    --ca-cert-file)
      return
      ;;
    --ca-cert-data)
      return
      ;;
    --client-cert-file)
      return
      ;;
    --client-cert-data)
      return
      ;;
    --client-key-file)
      return
      ;;
    --client-key-data)
      return
      ;;
    --client-key-algo)
      return
      ;;
    --client-key-passphrase)
      return
      ;;
    --http-proxy)
      return
      ;;
    --https-proxy)
      return
      ;;
    --proxy-username)
      return
      ;;
    --proxy-password)
      return
      ;;
    --no-proxy)
      return
      ;;
    --image-builder)
      return
      ;;
    --deployment-kind)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${kind_option_args[@]}" ) )
      return $?
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `knative` subcommand.
function _picocli_quarkus_deploy_knative() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests --image-build"
  local arg_opts="--config -D --api-server-url --username --password --token --trust-certs --namespace --ca-cert-file --ca-cert-data --client-cert-file --client-cert-data --client-key-file --client-key-data --client-key-algo --client-key-passphrase --http-proxy --https-proxy --proxy-username --proxy-password --no-proxy --image-builder"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --api-server-url)
      return
      ;;
    --username)
      return
      ;;
    --password)
      return
      ;;
    --token)
      return
      ;;
    --trust-certs)
      return
      ;;
    --namespace)
      return
      ;;
    --ca-cert-file)
      return
      ;;
    --ca-cert-data)
      return
      ;;
    --client-cert-file)
      return
      ;;
    --client-cert-data)
      return
      ;;
    --client-key-file)
      return
      ;;
    --client-key-data)
      return
      ;;
    --client-key-algo)
      return
      ;;
    --client-key-passphrase)
      return
      ;;
    --http-proxy)
      return
      ;;
    --https-proxy)
      return
      ;;
    --proxy-username)
      return
      ;;
    --proxy-password)
      return
      ;;
    --no-proxy)
      return
      ;;
    --image-builder)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `kind` subcommand.
function _picocli_quarkus_deploy_kind() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests --image-build"
  local arg_opts="--config -D --api-server-url --username --password --token --trust-certs --namespace --ca-cert-file --ca-cert-data --client-cert-file --client-cert-data --client-key-file --client-key-data --client-key-algo --client-key-passphrase --http-proxy --https-proxy --proxy-username --proxy-password --no-proxy --image-builder --deployment-kind"
  local kind_option_args=("Deployment" "StatefulSet" "Job") # --deployment-kind values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --api-server-url)
      return
      ;;
    --username)
      return
      ;;
    --password)
      return
      ;;
    --token)
      return
      ;;
    --trust-certs)
      return
      ;;
    --namespace)
      return
      ;;
    --ca-cert-file)
      return
      ;;
    --ca-cert-data)
      return
      ;;
    --client-cert-file)
      return
      ;;
    --client-cert-data)
      return
      ;;
    --client-key-file)
      return
      ;;
    --client-key-data)
      return
      ;;
    --client-key-algo)
      return
      ;;
    --client-key-passphrase)
      return
      ;;
    --http-proxy)
      return
      ;;
    --https-proxy)
      return
      ;;
    --proxy-username)
      return
      ;;
    --proxy-password)
      return
      ;;
    --no-proxy)
      return
      ;;
    --image-builder)
      return
      ;;
    --deployment-kind)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${kind_option_args[@]}" ) )
      return $?
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `minikube` subcommand.
function _picocli_quarkus_deploy_minikube() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help -B --batch-mode --dry-run --clean --native --offline --no-tests --image-build"
  local arg_opts="--config -D --api-server-url --username --password --token --trust-certs --namespace --ca-cert-file --ca-cert-data --client-cert-file --client-cert-data --client-key-file --client-key-data --client-key-algo --client-key-passphrase --http-proxy --https-proxy --proxy-username --proxy-password --no-proxy --image-builder --deployment-kind"
  local kind_option_args=("Deployment" "StatefulSet" "Job") # --deployment-kind values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    --api-server-url)
      return
      ;;
    --username)
      return
      ;;
    --password)
      return
      ;;
    --token)
      return
      ;;
    --trust-certs)
      return
      ;;
    --namespace)
      return
      ;;
    --ca-cert-file)
      return
      ;;
    --ca-cert-data)
      return
      ;;
    --client-cert-file)
      return
      ;;
    --client-cert-data)
      return
      ;;
    --client-key-file)
      return
      ;;
    --client-key-data)
      return
      ;;
    --client-key-algo)
      return
      ;;
    --client-key-passphrase)
      return
      ;;
    --http-proxy)
      return
      ;;
    --https-proxy)
      return
      ;;
    --proxy-username)
      return
      ;;
    --proxy-password)
      return
      ;;
    --no-proxy)
      return
      ;;
    --image-builder)
      return
      ;;
    --deployment-kind)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${kind_option_args[@]}" ) )
      return $?
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `list` subcommand.
function _picocli_quarkus_registry_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh -h --help --streams"
  local arg_opts="--config"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `add` subcommand.
function _picocli_quarkus_registry_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh -h --help"
  local arg_opts="--config"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `remove` subcommand.
function _picocli_quarkus_registry_remove() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh -h --help"
  local arg_opts="--config"

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `list` subcommand.
function _picocli_quarkus_plugin_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run -i --installable -c --show-command"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir -s --search"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
    -s|--search)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `ls` subcommand.
function _picocli_quarkus_plugin_ls() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run -i --installable -c --show-command"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir -s --search"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
    -s|--search)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `add` subcommand.
function _picocli_quarkus_plugin_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir -d --description"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
    -d|--description)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `remove` subcommand.
function _picocli_quarkus_plugin_remove() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `sync` subcommand.
function _picocli_quarkus_plugin_sync() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `list` subcommand.
function _picocli_quarkus_plug_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run -i --installable -c --show-command"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir -s --search"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
    -s|--search)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `ls` subcommand.
function _picocli_quarkus_plug_ls() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run -i --installable -c --show-command"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir -s --search"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
    -s|--search)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `add` subcommand.
function _picocli_quarkus_plug_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir -d --description"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
    -d|--description)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `remove` subcommand.
function _picocli_quarkus_plug_remove() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Generates completions for the options and subcommands of the `sync` subcommand.
function _picocli_quarkus_plug_sync() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-e --errors --verbose --refresh --registry-client -h --help --user -B --batch-mode --dry-run"
  local arg_opts="--config -D -t --type -S --stream -P --platform-bom --user-dir"
  local PLUGIN_TYPE_option_args=("jar" "java" "maven" "executable" "jbang") # --type values

  type compopt &>/dev/null && compopt +o default

  case ${prev_word} in
    --config)
      return
      ;;
    -D)
      return
      ;;
    -t|--type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${PLUGIN_TYPE_option_args[@]}" ) )
      return $?
      ;;
    -S|--stream)
      return
      ;;
    -P|--platform-bom)
      return
      ;;
    --user-dir)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

# Define a completion specification (a compspec) for the
# `quarkus`, `quarkus.sh`, and `quarkus.bash` commands.
# Uses the bash `complete` builtin (see [6]) to specify that shell function
# `_complete_quarkus` is responsible for generating possible completions for the
# current word on the command line.
# The `-o default` option means that if the function generated no matches, the
# default Bash completions and the Readline default filename completions are performed.
complete -F _complete_quarkus -o default quarkus quarkus.sh quarkus.bash

