#!/bin/zsh

### Print the path of a cloned bundle.
#
# usage: antidote path [-h|--help] <bundle>
#
#function antidote-path {
  emulate -L zsh; setopt local_options $_adote_funcopts

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

  if (( $#o_help )); then
    antidote-help path
    return
  fi

  if [[ $# -eq 0 ]]; then
    print >&2 "antidote: error: required argument 'bundle' not provided, try --help"
    return 1
  fi

  local bundle="$1"
  local bundledir=$(__antidote_bundle_dir $bundle)
  if [[ ! -d $bundledir ]]; then
    print >&2 "antidote: error: $bundle does not exist in cloned paths"
    return 1
  else
    print "$bundledir"
  fi
#}
