#!/usr/bin/env bash
# Command completion for localazy
# Generated by Clikt

__skip_opt_eq() {
    # this takes advantage of the fact that bash functions can write to local
    # variables in their callers
    (( i = i + 1 ))
    if [[ "${COMP_WORDS[$i]}" == '=' ]]; then
          (( i = i + 1 ))
    fi
}

__complete_files() {
   # Generate filename completions
   local word="$1"
   local IFS=$'\n'

   # quote each completion to support spaces and special characters
   COMPREPLY=($(compgen -o filenames -f -- "$word" | while read -r line; do
       printf "%q\n" "$line"
   done))
}

_localazy() {
  local i=1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --proxy)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--proxy' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      upload)
        _localazy_upload $(( i + 1 ))
        return
        ;;
      download)
        _localazy_download $(( i + 1 ))
        return
        ;;
      list)
        _localazy_list $(( i + 1 ))
        return
        ;;
      languages)
        _localazy_languages $(( i + 1 ))
        return
        ;;
      file)
        _localazy_file $(( i + 1 ))
        return
        ;;
      tag)
        _localazy_tag $(( i + 1 ))
        return
        ;;
      cdn)
        _localazy_cdn $(( i + 1 ))
        return
        ;;
      conversion)
        _localazy_conversion $(( i + 1 ))
        return
        ;;
      ios)
        _localazy_ios $(( i + 1 ))
        return
        ;;
      branch)
        _localazy_branch $(( i + 1 ))
        return
        ;;
      batch)
        _localazy_batch $(( i + 1 ))
        return
        ;;
      translate)
        _localazy_translate $(( i + 1 ))
        return
        ;;
      schema)
        _localazy_schema $(( i + 1 ))
        return
        ;;
      dump)
        _localazy_dump $(( i + 1 ))
        return
        ;;
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--proxy -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--proxy")
      ;;
    "--help")
      ;;
    *)
      COMPREPLY=($(compgen -W 'upload download list languages file tag cdn conversion ios branch batch translate schema dump' -- "${word}"))
      ;;
  esac
}

_localazy_upload() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name='GROUPS'
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -s|--simulate)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -q|--quiet)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -f|--force)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --failOnMissingGroups|--failonmissinggroups|--fail_on_missing_groups)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -p|--param)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--param' || in_param=''
          continue
          ;;
        -v|--app-version)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--app-version' || in_param=''
          continue
          ;;
        --project)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--project' || in_param=''
          continue
          ;;
        --async)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --disable-content-length)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -s --simulate -q --quiet -f --force --failOnMissingGroups --failonmissinggroups --fail_on_missing_groups -p --param -v --app-version --project --async --disable-content-length -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--simulate")
      ;;
    "--quiet")
      ;;
    "--force")
      ;;
    "--fail_on_missing_groups")
      ;;
    "--param")
      ;;
    "--app-version")
      ;;
    "--project")
      ;;
    "--async")
      ;;
    "--disable-content-length")
      ;;
    "--help")
      ;;
    "GROUPS")
      ;;
  esac
}

_localazy_download() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name='GROUPS'
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -s|--simulate)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -q|--quiet)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -f|--force)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --failOnMissingGroups|--failonmissinggroups|--fail_on_missing_groups)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -p|--param)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--param' || in_param=''
          continue
          ;;
        -t|--tag)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--tag' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -s --simulate -q --quiet -f --force --failOnMissingGroups --failonmissinggroups --fail_on_missing_groups -p --param -t --tag -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--simulate")
      ;;
    "--quiet")
      ;;
    "--force")
      ;;
    "--fail_on_missing_groups")
      ;;
    "--param")
      ;;
    "--tag")
      ;;
    "--help")
      ;;
    "GROUPS")
      ;;
  esac
}

_localazy_list() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -t|--tag)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--tag' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -t --tag -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--tag")
      ;;
    "--help")
      ;;
  esac
}

_localazy_languages() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        --csv)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -a|--add)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--add' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch --csv -a --add -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--csv")
      ;;
    "--add")
      ;;
    "--help")
      ;;
  esac
}

_localazy_file() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      list)
        _localazy_file_list $(( i + 1 ))
        return
        ;;
      rename)
        _localazy_file_rename $(( i + 1 ))
        return
        ;;
      delete)
        _localazy_file_delete $(( i + 1 ))
        return
        ;;
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--help")
      ;;
    *)
      COMPREPLY=($(compgen -W 'list rename delete' -- "${word}"))
      ;;
  esac
}

_localazy_file_list() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
  esac
}

_localazy_file_rename() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('FILE-ID')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -p|--path)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--path' || in_param=''
          continue
          ;;
        -f|--file)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--file' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-p --path -f --file -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--path")
      ;;
    "--file")
      ;;
    "--help")
      ;;
    "FILE-ID")
      ;;
  esac
}

_localazy_file_delete() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('FILE-ID')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
    "FILE-ID")
      ;;
  esac
}

_localazy_tag() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      publish)
        _localazy_tag_publish $(( i + 1 ))
        return
        ;;
      rename)
        _localazy_tag_rename $(( i + 1 ))
        return
        ;;
      promote)
        _localazy_tag_promote $(( i + 1 ))
        return
        ;;
      merge)
        _localazy_tag_merge $(( i + 1 ))
        return
        ;;
      list)
        _localazy_tag_list $(( i + 1 ))
        return
        ;;
      delete)
        _localazy_tag_delete $(( i + 1 ))
        return
        ;;
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--help")
      ;;
    *)
      COMPREPLY=($(compgen -W 'publish rename promote merge list delete' -- "${word}"))
      ;;
  esac
}

_localazy_tag_publish() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('TAG')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --sync)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--sync -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--sync")
      ;;
    "--help")
      ;;
    "TAG")
      ;;
  esac
}

_localazy_tag_rename() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('TAG' 'NEW-NAME')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
    "TAG")
      ;;
    "NEW-NAME")
      ;;
  esac
}

_localazy_tag_promote() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('TAG' 'TARGET')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
    "TAG")
      ;;
    "TARGET")
      ;;
  esac
}

_localazy_tag_merge() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('SOURCE_TAG' 'TARGET_TAG' 'OUTPUT_TAG')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --mode)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--mode' || in_param=''
          continue
          ;;
        --no-arrays-checks)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --different-sources)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --add-keys)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --rename-keys)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --remove-keys)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --file)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--file' || in_param=''
          continue
          ;;
        --key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--key' || in_param=''
          continue
          ;;
        --key-level-separator)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--key-level-separator' || in_param=''
          continue
          ;;
        --remove-unlisted-keys)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-key-prefix)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --update-project)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --update-meta)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --update-languages)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --add-languages)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --languages)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--languages' || in_param=''
          continue
          ;;
        --remove-unlisted-languages)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --remove-missing-languages)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --publish-languages)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--publish-languages' || in_param=''
          continue
          ;;
        --unpublish-languages)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--unpublish-languages' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--mode --no-arrays-checks --different-sources --add-keys --rename-keys --remove-keys --file --key --key-level-separator --remove-unlisted-keys --no-key-prefix --update-project --update-meta --update-languages --add-languages --languages --remove-unlisted-languages --remove-missing-languages --publish-languages --unpublish-languages -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--mode")
      ;;
    "--no-arrays-checks")
      ;;
    "--different-sources")
      ;;
    "--add-keys")
      ;;
    "--rename-keys")
      ;;
    "--remove-keys")
      ;;
    "--file")
      ;;
    "--key")
      ;;
    "--key-level-separator")
      ;;
    "--remove-unlisted-keys")
      ;;
    "--no-key-prefix")
      ;;
    "--update-project")
      ;;
    "--update-meta")
      ;;
    "--update-languages")
      ;;
    "--add-languages")
      ;;
    "--languages")
      ;;
    "--remove-unlisted-languages")
      ;;
    "--remove-missing-languages")
      ;;
    "--publish-languages")
      ;;
    "--unpublish-languages")
      ;;
    "--help")
      ;;
    "SOURCE_TAG")
      ;;
    "TARGET_TAG")
      ;;
    "OUTPUT_TAG")
      ;;
  esac
}

_localazy_tag_list() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
  esac
}

_localazy_tag_delete() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('TAG')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --sync)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--sync -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--sync")
      ;;
    "--help")
      ;;
    "TAG")
      ;;
  esac
}

_localazy_cdn() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -t|--tag)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--tag' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -t --tag -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--tag")
      ;;
    "--help")
      ;;
  esac
}

_localazy_conversion() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      list)
        _localazy_conversion_list $(( i + 1 ))
        return
        ;;
      format)
        _localazy_conversion_format $(( i + 1 ))
        return
        ;;
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--help")
      ;;
    *)
      COMPREPLY=($(compgen -W 'list format' -- "${word}"))
      ;;
  esac
}

_localazy_conversion_list() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
  esac
}

_localazy_conversion_format() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('CONV')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
    "CONV")
      ;;
  esac
}

_localazy_ios() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -o|--output)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--output' || in_param=''
          continue
          ;;
        -t|--tag)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--tag' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -o --output -t --tag -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--output")
      ;;
    "--tag")
      ;;
    "--help")
      ;;
  esac
}

_localazy_branch() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      create)
        _localazy_branch_create $(( i + 1 ))
        return
        ;;
      empty)
        _localazy_branch_empty $(( i + 1 ))
        return
        ;;
      list)
        _localazy_branch_list $(( i + 1 ))
        return
        ;;
      analyze)
        _localazy_branch_analyze $(( i + 1 ))
        return
        ;;
      conflicts)
        _localazy_branch_conflicts $(( i + 1 ))
        return
        ;;
      failures)
        _localazy_branch_failures $(( i + 1 ))
        return
        ;;
      merge)
        _localazy_branch_merge $(( i + 1 ))
        return
        ;;
      rename)
        _localazy_branch_rename $(( i + 1 ))
        return
        ;;
      main)
        _localazy_branch_main $(( i + 1 ))
        return
        ;;
      separate)
        _localazy_branch_separate $(( i + 1 ))
        return
        ;;
      delete)
        _localazy_branch_delete $(( i + 1 ))
        return
        ;;
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--help")
      ;;
    *)
      COMPREPLY=($(compgen -W 'create empty list analyze conflicts failures merge rename main separate delete' -- "${word}"))
      ;;
  esac
}

_localazy_branch_create() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('SOURCE' 'TARGET')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --async)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--async -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--async")
      ;;
    "--help")
      ;;
    "SOURCE")
      ;;
    "TARGET")
      ;;
  esac
}

_localazy_branch_empty() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('SOURCE' 'TARGET')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --async)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--async -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--async")
      ;;
    "--help")
      ;;
    "SOURCE")
      ;;
    "TARGET")
      ;;
  esac
}

_localazy_branch_list() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
  esac
}

_localazy_branch_analyze() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('SOURCE' 'TARGET')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-new-files)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-new-langs)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-new-keys)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --deprecate-missing)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --strategy)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--strategy' || in_param=''
          continue
          ;;
        --conflicts-only)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --skip-existing)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-fail-on-conflicts)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-fail-on-failures)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --langs)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--langs' || in_param=''
          continue
          ;;
        --keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-new-files --no-new-langs --no-new-keys --deprecate-missing --strategy --conflicts-only --skip-existing --no-fail-on-conflicts --no-fail-on-failures --langs --keys -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-new-files")
      ;;
    "--no-new-langs")
      ;;
    "--no-new-keys")
      ;;
    "--deprecate-missing")
      ;;
    "--strategy")
      ;;
    "--conflicts-only")
      ;;
    "--skip-existing")
      ;;
    "--no-fail-on-conflicts")
      ;;
    "--no-fail-on-failures")
      ;;
    "--langs")
      ;;
    "--keys")
      ;;
    "--help")
      ;;
    "SOURCE")
      ;;
    "TARGET")
      ;;
  esac
}

_localazy_branch_conflicts() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('SOURCE' 'TARGET')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-new-files)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-new-langs)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-new-keys)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --deprecate-missing)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --strategy)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--strategy' || in_param=''
          continue
          ;;
        --conflicts-only)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --skip-existing)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-fail-on-conflicts)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-fail-on-failures)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --langs)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--langs' || in_param=''
          continue
          ;;
        --keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-new-files --no-new-langs --no-new-keys --deprecate-missing --strategy --conflicts-only --skip-existing --no-fail-on-conflicts --no-fail-on-failures --langs --keys -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-new-files")
      ;;
    "--no-new-langs")
      ;;
    "--no-new-keys")
      ;;
    "--deprecate-missing")
      ;;
    "--strategy")
      ;;
    "--conflicts-only")
      ;;
    "--skip-existing")
      ;;
    "--no-fail-on-conflicts")
      ;;
    "--no-fail-on-failures")
      ;;
    "--langs")
      ;;
    "--keys")
      ;;
    "--help")
      ;;
    "SOURCE")
      ;;
    "TARGET")
      ;;
  esac
}

_localazy_branch_failures() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('SOURCE' 'TARGET')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-new-files)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-new-langs)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-new-keys)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --deprecate-missing)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --strategy)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--strategy' || in_param=''
          continue
          ;;
        --conflicts-only)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --skip-existing)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-fail-on-conflicts)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-fail-on-failures)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --langs)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--langs' || in_param=''
          continue
          ;;
        --keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-new-files --no-new-langs --no-new-keys --deprecate-missing --strategy --conflicts-only --skip-existing --no-fail-on-conflicts --no-fail-on-failures --langs --keys -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-new-files")
      ;;
    "--no-new-langs")
      ;;
    "--no-new-keys")
      ;;
    "--deprecate-missing")
      ;;
    "--strategy")
      ;;
    "--conflicts-only")
      ;;
    "--skip-existing")
      ;;
    "--no-fail-on-conflicts")
      ;;
    "--no-fail-on-failures")
      ;;
    "--langs")
      ;;
    "--keys")
      ;;
    "--help")
      ;;
    "SOURCE")
      ;;
    "TARGET")
      ;;
  esac
}

_localazy_branch_merge() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('SOURCE' 'TARGET')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-new-files)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-new-langs)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --no-new-keys)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --deprecate-missing)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --strategy)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--strategy' || in_param=''
          continue
          ;;
        --conflicts-only)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --skip-existing)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --dont-report-conflicts)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --langs)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--langs' || in_param=''
          continue
          ;;
        --keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        --async)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-new-files --no-new-langs --no-new-keys --deprecate-missing --strategy --conflicts-only --skip-existing --dont-report-conflicts --langs --keys --async -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-new-files")
      ;;
    "--no-new-langs")
      ;;
    "--no-new-keys")
      ;;
    "--deprecate-missing")
      ;;
    "--strategy")
      ;;
    "--conflicts-only")
      ;;
    "--skip-existing")
      ;;
    "--dont-report-conflicts")
      ;;
    "--langs")
      ;;
    "--keys")
      ;;
    "--async")
      ;;
    "--help")
      ;;
    "SOURCE")
      ;;
    "TARGET")
      ;;
  esac
}

_localazy_branch_rename() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('BRANCH' 'NAME')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
    "BRANCH")
      ;;
    "NAME")
      ;;
  esac
}

_localazy_branch_main() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('BRANCH' 'NAME')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
    "BRANCH")
      ;;
    "NAME")
      ;;
  esac
}

_localazy_branch_separate() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('BRANCH')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
    "BRANCH")
      ;;
  esac
}

_localazy_branch_delete() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('BRANCH')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
    "BRANCH")
      ;;
  esac
}

_localazy_batch() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      approve)
        _localazy_batch_approve $(( i + 1 ))
        return
        ;;
      translate)
        _localazy_batch_translate $(( i + 1 ))
        return
        ;;
      intm)
        _localazy_batch_intm $(( i + 1 ))
        return
        ;;
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--help")
      ;;
    *)
      COMPREPLY=($(compgen -W 'approve translate intm' -- "${word}"))
      ;;
  esac
}

_localazy_batch_approve() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --lang)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--lang' || in_param=''
          continue
          ;;
        --type)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--type' || in_param=''
          continue
          ;;
        --all-versions)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --process-approved)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --hidden)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --phrases)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--phrases' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--lang --type --all-versions --process-approved --hidden --phrases -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--lang")
      ;;
    "--type")
      ;;
    "--all-versions")
      ;;
    "--process-approved")
      ;;
    "--hidden")
      ;;
    "--phrases")
      ;;
    "--help")
      ;;
  esac
}

_localazy_batch_translate() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --lang)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--lang' || in_param=''
          continue
          ;;
        --engine)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--engine' || in_param=''
          continue
          ;;
        --approve)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --source-changed)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --waiting-for-review)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --hidden)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --source-lang)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--source-lang' || in_param=''
          continue
          ;;
        --phrases)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--phrases' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--lang --engine --approve --source-changed --waiting-for-review --hidden --source-lang --phrases -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--lang")
      ;;
    "--engine")
      ;;
    "--approve")
      ;;
    "--source-changed")
      ;;
    "--waiting-for-review")
      ;;
    "--hidden")
      ;;
    "--source-lang")
      ;;
    "--phrases")
      ;;
    "--help")
      ;;
  esac
}

_localazy_batch_intm() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --lang)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--lang' || in_param=''
          continue
          ;;
        --approve)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --source-projects)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--source-projects' || in_param=''
          continue
          ;;
        --all-sources)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --external-only)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --waiting-for-review)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --hidden)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        --phrases)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--phrases' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--lang --approve --source-projects --all-sources --external-only --waiting-for-review --hidden --phrases -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--lang")
      ;;
    "--approve")
      ;;
    "--source-projects")
      ;;
    "--all-sources")
      ;;
    "--external-only")
      ;;
    "--waiting-for-review")
      ;;
    "--hidden")
      ;;
    "--phrases")
      ;;
    "--help")
      ;;
  esac
}

_localazy_translate() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        --from)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--from' || in_param=''
          continue
          ;;
        --to)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--to' || in_param=''
          continue
          ;;
        --text|-t)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--text' || in_param=''
          continue
          ;;
        --key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--key' || in_param=''
          continue
          ;;
        --input)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--input' || in_param=''
          continue
          ;;
        --compact)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch --from --to --text -t --key --input --compact -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--from")
      ;;
    "--to")
      ;;
    "--text")
      ;;
    "--key")
      ;;
    "--input")
       __complete_files "${word}"
      ;;
    "--compact")
      ;;
    "--help")
      ;;
  esac
}

_localazy_schema() {
  local i=$1
  local in_param=''
  local fixed_arg_names=()
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '-h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--help")
      ;;
  esac
}

_localazy_dump() {
  local i=$1
  local in_param=''
  local fixed_arg_names=('OUTPUT')
  local vararg_name=''
  local can_parse_options=1

  while [[ ${i} -lt $COMP_CWORD ]]; do
    if [[ ${can_parse_options} -eq 1 ]]; then
      case "${COMP_WORDS[$i]}" in
        --)
          can_parse_options=0
          (( i = i + 1 ));
          continue
          ;;
        --no-colors)
          __skip_opt_eq
          in_param=''
          continue
          ;;
        -d|--working-dir)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--working-dir' || in_param=''
          continue
          ;;
        -c|--config)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--config' || in_param=''
          continue
          ;;
        -k|--keys)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--keys' || in_param=''
          continue
          ;;
        -r|--read-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--read-key' || in_param=''
          continue
          ;;
        -w|--write-key)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--write-key' || in_param=''
          continue
          ;;
        -b|--branch)
          __skip_opt_eq
          (( i = i + 1 ))
          [[ ${i} -gt COMP_CWORD ]] && in_param='--branch' || in_param=''
          continue
          ;;
        -h|--help)
          __skip_opt_eq
          in_param=''
          continue
          ;;
      esac
    fi
    case "${COMP_WORDS[$i]}" in
      *)
        (( i = i + 1 ))
        # drop the head of the array
        fixed_arg_names=("${fixed_arg_names[@]:1}")
        ;;
    esac
  done
  local word="${COMP_WORDS[$COMP_CWORD]}"
  if [[ "${word}" =~ ^[-] ]]; then
    COMPREPLY=($(compgen -W '--no-colors -d --working-dir -c --config -k --keys -r --read-key -w --write-key -b --branch -h --help' -- "${word}"))
    return
  fi

  # We're either at an option's value, or the first remaining fixed size
  # arg, or the vararg if there are no fixed args left
  [[ -z "${in_param}" ]] && in_param=${fixed_arg_names[0]}
  [[ -z "${in_param}" ]] && in_param=${vararg_name}

  case "${in_param}" in
    "--no-colors")
      ;;
    "--working-dir")
      ;;
    "--config")
       __complete_files "${word}"
      ;;
    "--keys")
       __complete_files "${word}"
      ;;
    "--read-key")
      ;;
    "--write-key")
      ;;
    "--branch")
      ;;
    "--help")
      ;;
    "OUTPUT")
      ;;
  esac
}

complete -F _localazy localazy
