#!/usr/bin/env bash
[[ " help certs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x

case "$1" in
  help | certs:help)
    cat<<EOF
    certs:add <app> CRT KEY, Add an ssl endpoint to an app. Can also import from a tarball on stdin
    certs:chain CRT [CRT ...], [NOT IMPLEMENTED] Print the ordered and complete chain for the given certificate.
    certs:generate <app> DOMAIN, Generate a key and certificate signing request (and self-signed certificate)
    certs:info <app>, Show certificate information for an ssl endpoint.
    certs:key <app> CRT KEY [KEY ...], [NOT IMPLEMENTED] Print the correct key for the given certificate.
    certs:remove <app>, Remove an SSL Endpoint from an app.
    certs:rollback <app>, [NOT IMPLEMENTED] Rollback an SSL Endpoint for an app.
    certs:update <app> CRT KEY, Update an SSL Endpoint on an app. Can also import from a tarball on stdin
EOF
    ;;

  *)
    exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
    ;;

esac
