#!/usr/bin/env bash
#
# crowdin Bash Completion
# =======================
#
# Bash completion support for the `crowdin` command,
# generated by [picocli](https://picocli.info/) version 4.7.6.
#
# 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 `crowdin [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
# 'crowdin (..)'. 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_crowdin 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_crowdin() {
  # 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]} upload" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} push" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} download" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} pull" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} init" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} status" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} string" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} glossary" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} tm" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} task" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} bundle" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} pre-translate" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} branch" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} comment" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} distribution" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} screenshot" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} label" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} file" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} language" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} config" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} project" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} app" ];    then _picocli_crowdin; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} upload translations" ];    then _picocli_crowdin_upload; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} upload sources" ];    then _picocli_crowdin_upload; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} push translations" ];    then _picocli_crowdin_push; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} push sources" ];    then _picocli_crowdin_push; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} download sources" ];    then _picocli_crowdin_download; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} download translations" ];    then _picocli_crowdin_download; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} pull sources" ];    then _picocli_crowdin_pull; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} pull translations" ];    then _picocli_crowdin_pull; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} status translation" ];    then _picocli_crowdin_status; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} status proofreading" ];    then _picocli_crowdin_status; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} string list" ];    then _picocli_crowdin_string; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} string add" ];    then _picocli_crowdin_string; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} string delete" ];    then _picocli_crowdin_string; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} string edit" ];    then _picocli_crowdin_string; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} glossary list" ];    then _picocli_crowdin_glossary; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} glossary upload" ];    then _picocli_crowdin_glossary; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} glossary download" ];    then _picocli_crowdin_glossary; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} tm list" ];    then _picocli_crowdin_tm; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} tm upload" ];    then _picocli_crowdin_tm; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} tm download" ];    then _picocli_crowdin_tm; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} task list" ];    then _picocli_crowdin_task; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} task add" ];    then _picocli_crowdin_task; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} bundle list" ];    then _picocli_crowdin_bundle; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} bundle add" ];    then _picocli_crowdin_bundle; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} bundle delete" ];    then _picocli_crowdin_bundle; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} bundle download" ];    then _picocli_crowdin_bundle; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} bundle clone" ];    then _picocli_crowdin_bundle; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} bundle browse" ];    then _picocli_crowdin_bundle; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} branch add" ];    then _picocli_crowdin_branch; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} branch clone" ];    then _picocli_crowdin_branch; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} branch delete" ];    then _picocli_crowdin_branch; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} branch list" ];    then _picocli_crowdin_branch; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} branch merge" ];    then _picocli_crowdin_branch; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} branch edit" ];    then _picocli_crowdin_branch; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} comment list" ];    then _picocli_crowdin_comment; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} comment resolve" ];    then _picocli_crowdin_comment; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} comment add" ];    then _picocli_crowdin_comment; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} distribution add" ];    then _picocli_crowdin_distribution; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} distribution list" ];    then _picocli_crowdin_distribution; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} distribution edit" ];    then _picocli_crowdin_distribution; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} distribution release" ];    then _picocli_crowdin_distribution; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} screenshot list" ];    then _picocli_crowdin_screenshot; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} screenshot upload" ];    then _picocli_crowdin_screenshot; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} screenshot delete" ];    then _picocli_crowdin_screenshot; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} label list" ];    then _picocli_crowdin_label; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} label add" ];    then _picocli_crowdin_label; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} label delete" ];    then _picocli_crowdin_label; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} file list" ];    then _picocli_crowdin_file; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} file upload" ];    then _picocli_crowdin_file; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} file download" ];    then _picocli_crowdin_file; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} file delete" ];    then _picocli_crowdin_file; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} language list" ];    then _picocli_crowdin_language; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} config sources" ];    then _picocli_crowdin_config; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} config translations" ];    then _picocli_crowdin_config; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} config lint" ];    then _picocli_crowdin_config; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} project browse" ];    then _picocli_crowdin_project; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} project list" ];    then _picocli_crowdin_project; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} project add" ];    then _picocli_crowdin_project; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} app list" ];    then _picocli_crowdin_app; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} app install" ];    then _picocli_crowdin_app; return $?; fi
  if [ "${COMP_LINE}" = "${COMP_WORDS[0]} app uninstall" ];    then _picocli_crowdin_app; return $?; fi

  # Find the longest sequence of subcommands and call the bash function for that subcommand.
  local cmds0=(upload)
  local cmds1=(push)
  local cmds2=(download)
  local cmds3=(pull)
  local cmds4=(init)
  local cmds5=(status)
  local cmds6=(string)
  local cmds7=(glossary)
  local cmds8=(tm)
  local cmds9=(task)
  local cmds10=(bundle)
  local cmds11=(pre-translate)
  local cmds12=(branch)
  local cmds13=(comment)
  local cmds14=(distribution)
  local cmds15=(screenshot)
  local cmds16=(label)
  local cmds17=(file)
  local cmds18=(language)
  local cmds19=(config)
  local cmds20=(project)
  local cmds21=(app)
  local cmds22=(upload translations)
  local cmds23=(upload sources)
  local cmds24=(push translations)
  local cmds25=(push sources)
  local cmds26=(download sources)
  local cmds27=(download translations)
  local cmds28=(pull sources)
  local cmds29=(pull translations)
  local cmds30=(status translation)
  local cmds31=(status proofreading)
  local cmds32=(string list)
  local cmds33=(string add)
  local cmds34=(string delete)
  local cmds35=(string edit)
  local cmds36=(glossary list)
  local cmds37=(glossary upload)
  local cmds38=(glossary download)
  local cmds39=(tm list)
  local cmds40=(tm upload)
  local cmds41=(tm download)
  local cmds42=(task list)
  local cmds43=(task add)
  local cmds44=(bundle list)
  local cmds45=(bundle add)
  local cmds46=(bundle delete)
  local cmds47=(bundle download)
  local cmds48=(bundle clone)
  local cmds49=(bundle browse)
  local cmds50=(branch add)
  local cmds51=(branch clone)
  local cmds52=(branch delete)
  local cmds53=(branch list)
  local cmds54=(branch merge)
  local cmds55=(branch edit)
  local cmds56=(comment list)
  local cmds57=(comment resolve)
  local cmds58=(comment add)
  local cmds59=(distribution add)
  local cmds60=(distribution list)
  local cmds61=(distribution edit)
  local cmds62=(distribution release)
  local cmds63=(screenshot list)
  local cmds64=(screenshot upload)
  local cmds65=(screenshot delete)
  local cmds66=(label list)
  local cmds67=(label add)
  local cmds68=(label delete)
  local cmds69=(file list)
  local cmds70=(file upload)
  local cmds71=(file download)
  local cmds72=(file delete)
  local cmds73=(language list)
  local cmds74=(config sources)
  local cmds75=(config translations)
  local cmds76=(config lint)
  local cmds77=(project browse)
  local cmds78=(project list)
  local cmds79=(project add)
  local cmds80=(app list)
  local cmds81=(app install)
  local cmds82=(app uninstall)

  if CompWordsContainsArray "${cmds82[@]}"; then _picocli_crowdin_app_uninstall; return $?; fi
  if CompWordsContainsArray "${cmds81[@]}"; then _picocli_crowdin_app_install; return $?; fi
  if CompWordsContainsArray "${cmds80[@]}"; then _picocli_crowdin_app_list; return $?; fi
  if CompWordsContainsArray "${cmds79[@]}"; then _picocli_crowdin_project_add; return $?; fi
  if CompWordsContainsArray "${cmds78[@]}"; then _picocli_crowdin_project_list; return $?; fi
  if CompWordsContainsArray "${cmds77[@]}"; then _picocli_crowdin_project_browse; return $?; fi
  if CompWordsContainsArray "${cmds76[@]}"; then _picocli_crowdin_config_lint; return $?; fi
  if CompWordsContainsArray "${cmds75[@]}"; then _picocli_crowdin_config_translations; return $?; fi
  if CompWordsContainsArray "${cmds74[@]}"; then _picocli_crowdin_config_sources; return $?; fi
  if CompWordsContainsArray "${cmds73[@]}"; then _picocli_crowdin_language_list; return $?; fi
  if CompWordsContainsArray "${cmds72[@]}"; then _picocli_crowdin_file_delete; return $?; fi
  if CompWordsContainsArray "${cmds71[@]}"; then _picocli_crowdin_file_download; return $?; fi
  if CompWordsContainsArray "${cmds70[@]}"; then _picocli_crowdin_file_upload; return $?; fi
  if CompWordsContainsArray "${cmds69[@]}"; then _picocli_crowdin_file_list; return $?; fi
  if CompWordsContainsArray "${cmds68[@]}"; then _picocli_crowdin_label_delete; return $?; fi
  if CompWordsContainsArray "${cmds67[@]}"; then _picocli_crowdin_label_add; return $?; fi
  if CompWordsContainsArray "${cmds66[@]}"; then _picocli_crowdin_label_list; return $?; fi
  if CompWordsContainsArray "${cmds65[@]}"; then _picocli_crowdin_screenshot_delete; return $?; fi
  if CompWordsContainsArray "${cmds64[@]}"; then _picocli_crowdin_screenshot_upload; return $?; fi
  if CompWordsContainsArray "${cmds63[@]}"; then _picocli_crowdin_screenshot_list; return $?; fi
  if CompWordsContainsArray "${cmds62[@]}"; then _picocli_crowdin_distribution_release; return $?; fi
  if CompWordsContainsArray "${cmds61[@]}"; then _picocli_crowdin_distribution_edit; return $?; fi
  if CompWordsContainsArray "${cmds60[@]}"; then _picocli_crowdin_distribution_list; return $?; fi
  if CompWordsContainsArray "${cmds59[@]}"; then _picocli_crowdin_distribution_add; return $?; fi
  if CompWordsContainsArray "${cmds58[@]}"; then _picocli_crowdin_comment_add; return $?; fi
  if CompWordsContainsArray "${cmds57[@]}"; then _picocli_crowdin_comment_resolve; return $?; fi
  if CompWordsContainsArray "${cmds56[@]}"; then _picocli_crowdin_comment_list; return $?; fi
  if CompWordsContainsArray "${cmds55[@]}"; then _picocli_crowdin_branch_edit; return $?; fi
  if CompWordsContainsArray "${cmds54[@]}"; then _picocli_crowdin_branch_merge; return $?; fi
  if CompWordsContainsArray "${cmds53[@]}"; then _picocli_crowdin_branch_list; return $?; fi
  if CompWordsContainsArray "${cmds52[@]}"; then _picocli_crowdin_branch_delete; return $?; fi
  if CompWordsContainsArray "${cmds51[@]}"; then _picocli_crowdin_branch_clone; return $?; fi
  if CompWordsContainsArray "${cmds50[@]}"; then _picocli_crowdin_branch_add; return $?; fi
  if CompWordsContainsArray "${cmds49[@]}"; then _picocli_crowdin_bundle_browse; return $?; fi
  if CompWordsContainsArray "${cmds48[@]}"; then _picocli_crowdin_bundle_clone; return $?; fi
  if CompWordsContainsArray "${cmds47[@]}"; then _picocli_crowdin_bundle_download; return $?; fi
  if CompWordsContainsArray "${cmds46[@]}"; then _picocli_crowdin_bundle_delete; return $?; fi
  if CompWordsContainsArray "${cmds45[@]}"; then _picocli_crowdin_bundle_add; return $?; fi
  if CompWordsContainsArray "${cmds44[@]}"; then _picocli_crowdin_bundle_list; return $?; fi
  if CompWordsContainsArray "${cmds43[@]}"; then _picocli_crowdin_task_add; return $?; fi
  if CompWordsContainsArray "${cmds42[@]}"; then _picocli_crowdin_task_list; return $?; fi
  if CompWordsContainsArray "${cmds41[@]}"; then _picocli_crowdin_tm_download; return $?; fi
  if CompWordsContainsArray "${cmds40[@]}"; then _picocli_crowdin_tm_upload; return $?; fi
  if CompWordsContainsArray "${cmds39[@]}"; then _picocli_crowdin_tm_list; return $?; fi
  if CompWordsContainsArray "${cmds38[@]}"; then _picocli_crowdin_glossary_download; return $?; fi
  if CompWordsContainsArray "${cmds37[@]}"; then _picocli_crowdin_glossary_upload; return $?; fi
  if CompWordsContainsArray "${cmds36[@]}"; then _picocli_crowdin_glossary_list; return $?; fi
  if CompWordsContainsArray "${cmds35[@]}"; then _picocli_crowdin_string_edit; return $?; fi
  if CompWordsContainsArray "${cmds34[@]}"; then _picocli_crowdin_string_delete; return $?; fi
  if CompWordsContainsArray "${cmds33[@]}"; then _picocli_crowdin_string_add; return $?; fi
  if CompWordsContainsArray "${cmds32[@]}"; then _picocli_crowdin_string_list; return $?; fi
  if CompWordsContainsArray "${cmds31[@]}"; then _picocli_crowdin_status_proofreading; return $?; fi
  if CompWordsContainsArray "${cmds30[@]}"; then _picocli_crowdin_status_translation; return $?; fi
  if CompWordsContainsArray "${cmds29[@]}"; then _picocli_crowdin_pull_translations; return $?; fi
  if CompWordsContainsArray "${cmds28[@]}"; then _picocli_crowdin_pull_sources; return $?; fi
  if CompWordsContainsArray "${cmds27[@]}"; then _picocli_crowdin_download_translations; return $?; fi
  if CompWordsContainsArray "${cmds26[@]}"; then _picocli_crowdin_download_sources; return $?; fi
  if CompWordsContainsArray "${cmds25[@]}"; then _picocli_crowdin_push_sources; return $?; fi
  if CompWordsContainsArray "${cmds24[@]}"; then _picocli_crowdin_push_translations; return $?; fi
  if CompWordsContainsArray "${cmds23[@]}"; then _picocli_crowdin_upload_sources; return $?; fi
  if CompWordsContainsArray "${cmds22[@]}"; then _picocli_crowdin_upload_translations; return $?; fi
  if CompWordsContainsArray "${cmds21[@]}"; then _picocli_crowdin_app; return $?; fi
  if CompWordsContainsArray "${cmds20[@]}"; then _picocli_crowdin_project; return $?; fi
  if CompWordsContainsArray "${cmds19[@]}"; then _picocli_crowdin_config; return $?; fi
  if CompWordsContainsArray "${cmds18[@]}"; then _picocli_crowdin_language; return $?; fi
  if CompWordsContainsArray "${cmds17[@]}"; then _picocli_crowdin_file; return $?; fi
  if CompWordsContainsArray "${cmds16[@]}"; then _picocli_crowdin_label; return $?; fi
  if CompWordsContainsArray "${cmds15[@]}"; then _picocli_crowdin_screenshot; return $?; fi
  if CompWordsContainsArray "${cmds14[@]}"; then _picocli_crowdin_distribution; return $?; fi
  if CompWordsContainsArray "${cmds13[@]}"; then _picocli_crowdin_comment; return $?; fi
  if CompWordsContainsArray "${cmds12[@]}"; then _picocli_crowdin_branch; return $?; fi
  if CompWordsContainsArray "${cmds11[@]}"; then _picocli_crowdin_pretranslate; return $?; fi
  if CompWordsContainsArray "${cmds10[@]}"; then _picocli_crowdin_bundle; return $?; fi
  if CompWordsContainsArray "${cmds9[@]}"; then _picocli_crowdin_task; return $?; fi
  if CompWordsContainsArray "${cmds8[@]}"; then _picocli_crowdin_tm; return $?; fi
  if CompWordsContainsArray "${cmds7[@]}"; then _picocli_crowdin_glossary; return $?; fi
  if CompWordsContainsArray "${cmds6[@]}"; then _picocli_crowdin_string; return $?; fi
  if CompWordsContainsArray "${cmds5[@]}"; then _picocli_crowdin_status; return $?; fi
  if CompWordsContainsArray "${cmds4[@]}"; then _picocli_crowdin_init; return $?; fi
  if CompWordsContainsArray "${cmds3[@]}"; then _picocli_crowdin_pull; return $?; fi
  if CompWordsContainsArray "${cmds2[@]}"; then _picocli_crowdin_download; return $?; fi
  if CompWordsContainsArray "${cmds1[@]}"; then _picocli_crowdin_push; return $?; fi
  if CompWordsContainsArray "${cmds0[@]}"; then _picocli_crowdin_upload; return $?; fi

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

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

  local commands="upload push download pull init status string glossary tm task bundle pre-translate branch comment distribution screenshot label file language config project app"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `upload` subcommand.
function _picocli_crowdin_upload() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="translations sources"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --delete-obsolete --no-auto-update --tree --dryrun --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch --label --excluded-language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    --label)
      return
      ;;
    --excluded-language)
      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_crowdin_push() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="translations sources"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --delete-obsolete --no-auto-update --tree --dryrun --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch --label --excluded-language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    --label)
      return
      ;;
    --excluded-language)
      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 `download` subcommand.
function _picocli_crowdin_download() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="sources translations"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --ignore-match --pseudo --skip-untranslated-strings --skip-untranslated-files --export-only-approved --keep-archive --all --dryrun --tree --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch -l --language -e --exclude-language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    -l|--language)
      return
      ;;
    -e|--exclude-language)
      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 `pull` subcommand.
function _picocli_crowdin_pull() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="sources translations"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --ignore-match --pseudo --skip-untranslated-strings --skip-untranslated-files --export-only-approved --keep-archive --all --dryrun --tree --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch -l --language -e --exclude-language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    -l|--language)
      return
      ;;
    -e|--exclude-language)
      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 `init` subcommand.
function _picocli_crowdin_init() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --quiet"
  local arg_opts="-d --destination -T --token -i --project-id --base-path --base-url -s --source -t --translation"

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

  case ${prev_word} in
    -d|--destination)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --base-path)
      return
      ;;
    --base-url)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      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 `status` subcommand.
function _picocli_crowdin_status() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands="translation proofreading"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --fail-if-incomplete --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -l --language -b --branch -f --file -d --directory"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -l|--language)
      return
      ;;
    -b|--branch)
      return
      ;;
    -f|--file)
      return
      ;;
    -d|--directory)
      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 `string` subcommand.
function _picocli_crowdin_string() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list add delete edit"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `glossary` subcommand.
function _picocli_crowdin_glossary() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list upload download"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `tm` subcommand.
function _picocli_crowdin_tm() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list upload download"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `task` subcommand.
function _picocli_crowdin_task() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list add"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `bundle` subcommand.
function _picocli_crowdin_bundle() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list add delete download clone browse"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `pre-translate` subcommand.
function _picocli_crowdin_pretranslate() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --duplicate-translations --translate-untranslated-only --translate-with-perfect-match-only --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -l --language --file --method --engine-id -b --branch --directory --auto-approve-option --label --ai-prompt"
  local _option_args=("TM" "MT" "AI") # --method values

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -l|--language)
      return
      ;;
    --file)
      return
      ;;
    --method)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_option_args[@]}" ) )
      return $?
      ;;
    --engine-id)
      return
      ;;
    -b|--branch)
      return
      ;;
    --directory)
      return
      ;;
    --auto-approve-option)
      return
      ;;
    --label)
      return
      ;;
    --ai-prompt)
      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 `branch` subcommand.
function _picocli_crowdin_branch() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="add clone delete list merge edit"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `comment` subcommand.
function _picocli_crowdin_comment() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list resolve add"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `distribution` subcommand.
function _picocli_crowdin_distribution() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="add list edit release"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `screenshot` subcommand.
function _picocli_crowdin_screenshot() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list upload delete"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `label` subcommand.
function _picocli_crowdin_label() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list add delete"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `file` subcommand.
function _picocli_crowdin_file() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list upload download delete"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `language` subcommand.
function _picocli_crowdin_language() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `config` subcommand.
function _picocli_crowdin_config() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="sources translations lint"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `project` subcommand.
function _picocli_crowdin_project() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="browse list add"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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_crowdin_app() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}

  local commands="list install uninstall"
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  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 `translations` subcommand.
function _picocli_crowdin_upload_translations() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --auto-approve-imported --import-eq-suggestions --translate-hidden --dryrun --tree --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch -l --language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    -l|--language)
      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 `sources` subcommand.
function _picocli_crowdin_upload_sources() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --delete-obsolete --no-auto-update --tree --dryrun --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch --label --excluded-language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    --label)
      return
      ;;
    --excluded-language)
      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 `translations` subcommand.
function _picocli_crowdin_push_translations() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --auto-approve-imported --import-eq-suggestions --translate-hidden --dryrun --tree --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch -l --language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    -l|--language)
      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 `sources` subcommand.
function _picocli_crowdin_push_sources() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --delete-obsolete --no-auto-update --tree --dryrun --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch --label --excluded-language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    --label)
      return
      ;;
    --excluded-language)
      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 `sources` subcommand.
function _picocli_crowdin_download_sources() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --plain --reviewed --dryrun"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      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 `translations` subcommand.
function _picocli_crowdin_download_translations() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --ignore-match --pseudo --skip-untranslated-strings --skip-untranslated-files --export-only-approved --keep-archive --all --dryrun --tree --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch -l --language -e --exclude-language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    -l|--language)
      return
      ;;
    -e|--exclude-language)
      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 `sources` subcommand.
function _picocli_crowdin_pull_sources() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --plain --reviewed --dryrun"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      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 `translations` subcommand.
function _picocli_crowdin_pull_translations() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --ignore-match --pseudo --skip-untranslated-strings --skip-untranslated-files --export-only-approved --keep-archive --all --dryrun --tree --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch -l --language -e --exclude-language"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      return
      ;;
    -l|--language)
      return
      ;;
    -e|--exclude-language)
      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 `translation` subcommand.
function _picocli_crowdin_status_translation() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --fail-if-incomplete --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -l --language -b --branch -f --file -d --directory"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -l|--language)
      return
      ;;
    -b|--branch)
      return
      ;;
    -f|--file)
      return
      ;;
    -d|--directory)
      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 `proofreading` subcommand.
function _picocli_crowdin_status_proofreading() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --fail-if-incomplete --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -l --language -b --branch -f --file -d --directory"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -l|--language)
      return
      ;;
    -b|--branch)
      return
      ;;
    -f|--file)
      return
      ;;
    -d|--directory)
      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_crowdin_string_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --file --filter -b --branch --label --croql --directory --scope"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --file)
      return
      ;;
    --filter)
      return
      ;;
    -b|--branch)
      return
      ;;
    --label)
      return
      ;;
    --croql)
      return
      ;;
    --directory)
      return
      ;;
    --scope)
      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_crowdin_string_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --hidden --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --identifier --max-length --context --file --label -b --branch --one --two --few --many --zero"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --identifier)
      return
      ;;
    --max-length)
      return
      ;;
    --context)
      return
      ;;
    --file)
      return
      ;;
    --label)
      return
      ;;
    -b|--branch)
      return
      ;;
    --one)
      return
      ;;
    --two)
      return
      ;;
    --few)
      return
      ;;
    --many)
      return
      ;;
    --zero)
      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 `delete` subcommand.
function _picocli_crowdin_string_delete() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `edit` subcommand.
function _picocli_crowdin_string_edit() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --hidden --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --identifier --text --context --max-length --label"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --identifier)
      return
      ;;
    --text)
      return
      ;;
    --context)
      return
      ;;
    --max-length)
      return
      ;;
    --label)
      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_crowdin_glossary_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      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 `upload` subcommand.
function _picocli_crowdin_glossary_upload() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --first-line-contains-header --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path --id --language --scheme"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    --id)
      return
      ;;
    --language)
      return
      ;;
    --scheme)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local currIndex
    currIndex=$(currentPositionalIndex "upload" "${arg_opts}" "${flag_opts}")
    if (( currIndex >= 0 && currIndex <= 0 )); then
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      positionals=$( compgen -f -- "${curr_word}" ) # files
    fi
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

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

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path --format --to"
  local _option_args=("TBX" "TBX_V3" "CSV" "XLSX") # --format values

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    --format)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_option_args[@]}" ) )
      return $?
      ;;
    --to)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      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_crowdin_tm_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      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 `upload` subcommand.
function _picocli_crowdin_tm_upload() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --first-line-contains-header --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path --id --language --scheme"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    --id)
      return
      ;;
    --language)
      return
      ;;
    --scheme)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local currIndex
    currIndex=$(currentPositionalIndex "upload" "${arg_opts}" "${flag_opts}")
    if (( currIndex >= 0 && currIndex <= 0 )); then
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      positionals=$( compgen -f -- "${curr_word}" ) # files
    fi
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

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

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path --source-language-id --target-language-id --format --to"
  local _option_args=("TMX" "CSV" "XLSX") # --format values

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    --source-language-id)
      return
      ;;
    --target-language-id)
      return
      ;;
    --format)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_option_args[@]}" ) )
      return $?
      ;;
    --to)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      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_crowdin_task_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --status --assignee-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --status)
      return
      ;;
    --assignee-id)
      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_crowdin_task_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --skip-assigned-strings --include-pre-translated-strings-only --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --type --language --file -b --branch --workflow-step --description --label"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --type)
      return
      ;;
    --language)
      return
      ;;
    --file)
      return
      ;;
    -b|--branch)
      return
      ;;
    --workflow-step)
      return
      ;;
    --description)
      return
      ;;
    --label)
      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_crowdin_bundle_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_bundle_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain --include-source-language --include-pseudo-language --multilingual"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --format --source --ignore --translation --label"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --format)
      return
      ;;
    --source)
      return
      ;;
    --ignore)
      return
      ;;
    --translation)
      return
      ;;
    --label)
      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 `delete` subcommand.
function _picocli_crowdin_bundle_delete() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `download` subcommand.
function _picocli_crowdin_bundle_download() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain --keep-archive --dryrun"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `clone` subcommand.
function _picocli_crowdin_bundle_clone() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain --include-source-language --include-pseudo-language --multilingual"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --name --format --source --ignore --translation --label"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --name)
      return
      ;;
    --format)
      return
      ;;
    --source)
      return
      ;;
    --ignore)
      return
      ;;
    --translation)
      return
      ;;
    --label)
      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 `browse` subcommand.
function _picocli_crowdin_bundle_browse() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_branch_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --title --export-pattern --priority"
  local _option_args=("LOW" "NORMAL" "HIGH") # --priority values

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --title)
      return
      ;;
    --export-pattern)
      return
      ;;
    --priority)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_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 `clone` subcommand.
function _picocli_crowdin_branch_clone() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `delete` subcommand.
function _picocli_crowdin_branch_delete() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_branch_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `merge` subcommand.
function _picocli_crowdin_branch_merge() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --dryrun --delete-after-merge --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `edit` subcommand.
function _picocli_crowdin_branch_edit() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --name --title --priority"
  local _option_args=("LOW" "NORMAL" "HIGH") # --priority values

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --name)
      return
      ;;
    --title)
      return
      ;;
    --priority)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_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_crowdin_comment_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --string-id --type --issue-type --status"
  local _option_args=("COMMENT" "ISSUE") # --type values
  local _option_args=("ALL" "GENERAL_QUESTION" "TRANSLATION_MISTAKE" "CONTEXT_REQUEST" "SOURCE_MISTAKE") # --issue-type values
  local _option_args=("RESOLVED" "UNRESOLVED") # --status values

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --string-id)
      return
      ;;
    --type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_option_args[@]}" ) )
      return $?
      ;;
    --issue-type)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_option_args[@]}" ) )
      return $?
      ;;
    --status)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_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 `resolve` subcommand.
function _picocli_crowdin_comment_resolve() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_comment_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --string-id -l --language --type --issue-type"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --string-id)
      return
      ;;
    -l|--language)
      return
      ;;
    --type)
      return
      ;;
    --issue-type)
      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_crowdin_distribution_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --export-mode --file --bundle-id -b --branch"
  local _option_args=("DEFAULT" "BUNDLE") # --export-mode values

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --export-mode)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_option_args[@]}" ) )
      return $?
      ;;
    --file)
      return
      ;;
    --bundle-id)
      return
      ;;
    -b|--branch)
      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_crowdin_distribution_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `edit` subcommand.
function _picocli_crowdin_distribution_edit() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --name --export-mode --file --bundle-id -b --branch"
  local _option_args=("DEFAULT" "BUNDLE") # --export-mode values

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --name)
      return
      ;;
    --export-mode)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_option_args[@]}" ) )
      return $?
      ;;
    --file)
      return
      ;;
    --bundle-id)
      return
      ;;
    -b|--branch)
      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 `release` subcommand.
function _picocli_crowdin_distribution_release() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_screenshot_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --string-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --string-id)
      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 `upload` subcommand.
function _picocli_crowdin_screenshot_upload() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --auto-tag --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -f --file -b --branch --label -d --directory"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -f|--file)
      return
      ;;
    -b|--branch)
      return
      ;;
    --label)
      return
      ;;
    -d|--directory)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local currIndex
    currIndex=$(currentPositionalIndex "upload" "${arg_opts}" "${flag_opts}")
    if (( currIndex >= 0 && currIndex <= 0 )); then
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      positionals=$( compgen -f -- "${curr_word}" ) # files
    fi
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

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

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_label_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_label_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `delete` subcommand.
function _picocli_crowdin_label_delete() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_file_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --tree --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -b --branch"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -b|--branch)
      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 `upload` subcommand.
function _picocli_crowdin_file_upload() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --no-auto-update --cleanup-mode --update-strings --plain --xliff"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -b --branch --label -d --dest --context --type --parser-version --excluded-language -l --language"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -b|--branch)
      return
      ;;
    --label)
      return
      ;;
    -d|--dest)
      return
      ;;
    --context)
      return
      ;;
    --type)
      return
      ;;
    --parser-version)
      return
      ;;
    --excluded-language)
      return
      ;;
    -l|--language)
      return
      ;;
  esac

  if [[ "${curr_word}" == -* ]]; then
    COMPREPLY=( $(compgen -W "${flag_opts} ${arg_opts}" -- "${curr_word}") )
  else
    local positionals=""
    local currIndex
    currIndex=$(currentPositionalIndex "upload" "${arg_opts}" "${flag_opts}")
    if (( currIndex >= 0 && currIndex <= 0 )); then
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      positionals=$( compgen -f -- "${curr_word}" ) # files
    fi
    local IFS=$'\n'
    COMPREPLY=( $(compgen -W "${commands// /$'\n'}${IFS}${positionals}" -- "${curr_word}") )
  fi
}

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

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -l --language -b --branch -d --dest"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -l|--language)
      return
      ;;
    -b|--branch)
      return
      ;;
    -d|--dest)
      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 `delete` subcommand.
function _picocli_crowdin_file_delete() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -b --branch"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -b|--branch)
      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_crowdin_language_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --all --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id --code"
  local _option_args=("id" "two_letters_code" "three_letters_code" "locale" "android_code" "osx_code" "osx_locale") # --code values

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    --code)
      local IFS=$'\n'
      COMPREPLY=( $( compReplyArray "${_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 `sources` subcommand.
function _picocli_crowdin_config_sources() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --tree --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity -b --branch"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -b|--branch)
      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 `translations` subcommand.
function _picocli_crowdin_config_translations() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --preserve-hierarchy --tree --plain"
  local arg_opts="-T --token --base-url --base-path -i --project-id -s --source -t --translation --dest -c --config --identity"

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

  case ${prev_word} in
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -s|--source)
      return
      ;;
    -t|--translation)
      return
      ;;
    --dest)
      return
      ;;
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      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 `lint` subcommand.
function _picocli_crowdin_config_lint() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      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 `browse` subcommand.
function _picocli_crowdin_project_browse() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_project_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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_crowdin_project_add() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --public --string-based --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id -l --language --source-language"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      return
      ;;
    -l|--language)
      return
      ;;
    --source-language)
      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_crowdin_app_list() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --plain"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `install` subcommand.
function _picocli_crowdin_app_install() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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 `uninstall` subcommand.
function _picocli_crowdin_app_uninstall() {
  # Get completion data
  local curr_word=${COMP_WORDS[COMP_CWORD]}
  local prev_word=${COMP_WORDS[COMP_CWORD-1]}

  local commands=""
  local flag_opts="-V --version -h --help --no-progress -v --verbose --no-colors --force"
  local arg_opts="-c --config --identity -T --token --base-url --base-path -i --project-id"

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

  case ${prev_word} in
    -c|--config)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    --identity)
      local IFS=$'\n'
      type compopt &>/dev/null && compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;
    -T|--token)
      return
      ;;
    --base-url)
      return
      ;;
    --base-path)
      return
      ;;
    -i|--project-id)
      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
# `crowdin`, `crowdin.sh`, and `crowdin.bash` commands.
# Uses the bash `complete` builtin (see [6]) to specify that shell function
# `_complete_crowdin` 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_crowdin -o default crowdin crowdin.sh crowdin.bash
