#compdef kyoto
#
# this is zsh completion function file.
# partially generated by genzshcomp(ver: 0.6.0)
#

_kyoto_commands() {
  local -a subcmds=(
    'configure:create Makefile for corpus preprocessing'
    'show:show corpus content in a tree format'
    'list:list document IDs'
    'ls:list document IDs'
    'idsplit:split corpus following ID files'
  )
  _describe -t commands "subcommand" subcmds
}

_kyoto() {
  _arguments -s -S -C \
    "-h[show this help message and exit]:" \
    "--help[show this help message and exit]:" \
    '1: :_kyoto_commands' \
    '*:: :->command_args'

  case $state in
  command_args)
    case $words[1] in
    configure)
      _arguments -s -S \
        "-h[show this help message and exit]:" \
        "--help[show this help message and exit]:" \
        "-c[path to directory where downloaded corpus files exist]::CORPUS_DIR:_files" \
        "--corpus-dir[path to directory where downloaded corpus files exist]::CORPUS_DIR:_files" \
        "-d[path to directory where processed files will be saved]::DATA_DIR:_files" \
        "--data-dir[path to directory where processed files will be saved]::DATA_DIR:_files" \
        "--juman-dic-dir[path to directory where JumanDIC files exist]::JUMAN_DIC_DIR:_files" \
        "--makefile-dir[path to directory where Makefile will be created (default: same as --data-dir)]::MAKEFILE_DIR:_files" \
        "--makefile-name[name of makefile to be created (default: Makefile)]::MAKEFILE_NAME:_files" \
        "--knp[path to knp (default: follow PATH environment variable)]::KNP:_files"
      ;;

    show)
      _arguments -s -S \
        "-h[show this help message and exit]:" \
        "--help[show this help message and exit]:" \
        "--cases[...\]\] target cases separated by \" \" (default: all cases)]::[CASES:_files" \
        "1::path:_files"
      ;;

    list)
      _arguments -s -S \
        "1::path:_files"
      ;;

    idsplit)
      _arguments -s -S \
        "-h[show this help message and exit]:" \
        "--help[show this help message and exit]:" \
        "-c[path to directory where all corpus files exist]::CORPUS_DIR:_files" \
        "--corpus-dir[path to directory where all corpus files exist]::CORPUS_DIR:_files" \
        "-o[path to directory where copied files will be saved]::OUTPUT_DIR:_files" \
        "--output-dir[path to directory where copied files will be saved]::OUTPUT_DIR:_files" \
        "--train[path to train id file]::TRAIN:_files" \
        "--dev[path to dev id file]::DEV:_files" \
        "--valid[path to valid id file]::VALID:_files" \
        "--test[path to test id file]::TEST:_files" \
      ;;
    esac
    ;;
  esac
}

_kyoto "$@"
