#!/usr/bin/env bash

source .utils

CONTEXT_NAME=$(kubectl config current-context | sed -e "s/kind-//")

print_usage() {
  orange "kind-delete-cluster - delete a Kind cluster"
  echo " "
  underline "Usage:"
  echo "kind-delete-cluster [cluster-name]"
  echo " "
  echo "If no cluster-name is provided it will attempt to get it from the current kubectl context"
  echo " "
  underline "Options:"
  echo "-h, --help            show this help text"
}

# Positional args
NAME=${1:-${CONTEXT_NAME}}

kind delete cluster --name ${NAME}
