#compdef mkapi
_mkapi(){
  typeset -A opt_args;
  local context state state_descr line ret=1;
  local actions options commands;

  options=(
    "(-o --output)"{-o=,--output=}"[Write output to FILE]:file:_files" 
    "(-t --title)"{-t=,--title=}"[Title for initial heading]" 
    "(-l --level)"{-l=,--level=}"[Initial heading level]" 
    "(-L --lang)"{-L=,--lang=}"[Language for fenced code blocks]" 
    "(-i --indent)"{-i=,--indent=}"[Number of spaces for JSON]" 
    "(-a --ast)"{-a,--ast}"[Print AST as JSON]" 
    "(--private --no-private)"{--private,--no-private}"[Enable or disable private symbols]" 
    "(--protected --no-protected)"{--protected,--no-protected}"[Enable or disable protected symbols]" 
    "(-h --help)"{-h,--help}"[Display help and exit]" 
    "--version[Print the version and exit]"
  )

  actions=(
    "*:file:_files"
  )

  _arguments \
    $options \
    $actions && ret=0;

  (( $ret == 1 )) && _arguments \
    $options \
    $actions && ret=0;
  return $ret;
}

_mkapi "$@"