#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"

cmd-tags-default() {
  declare desc="shows docker images tags for app via command line"
  declare cmd="tags"
  [[ "$1" == "$cmd" ]] && shift 1
  declare APP="$1"

  verify_app_name "$APP"

  local IMAGE_REPO=$(get_app_image_repo "$APP")
  dokku_log_info2_quiet "Image tags for $IMAGE_REPO"
  "$DOCKER_BIN" image list "$IMAGE_REPO"
}

cmd-tags-default "$@"
