#!/bin/zsh

### Show antidote documentation.
#
# usage: antidote [-h|--help] [<command>]
#        antidote help [<command>]
#

#function antidote-help {
  emulate -L zsh; setopt local_options $_adote_funcopts

  local o_help
  zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1

  local manpage

  if (( $#o_help )); then
    manpage=antidote-help
  elif [[ "$1" == antidote ]]; then
    manpage=antidote
  elif [[ -n "$1" ]]; then
    manpage="antidote-${1}"
  fi

  if (( $+commands[man] )) && [[ -n "$manpage" ]]; then
    man "$manpage" || {
      __antidote_usage && return 1
    }
  else
    __antidote_usage
  fi
#}
