#!/usr/bin/env bash
[[ " caddy:help caddy:labels:add caddy:labels:remove caddy:labels:show help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/help-functions"
source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/command-functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x

case "$1" in
  help | caddy:help)
    cmd-caddy-help "$@"
    ;;

  caddy:labels:add)
    cmd-caddy-labels-add "$@"
    ;;

  caddy:labels:remove)
    cmd-caddy-labels-remove "$@"
    ;;

  caddy:labels:show)
    cmd-caddy-labels-show "$@"
    ;;

  *)
    exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
    ;;
esac
