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

storage_list_cmd() {
  declare desc="List all bound mounts"
  local cmd="storage:list"
  local passed_phases="deploy"
  [[ ! $2 ]] && dokku_log_fail "storage:list requires an app to list."
  verify_app_name "$2" && local APP="$2"
  echo "$APP volume bind-mounts:"
  get_bind_mounts "$(get_phase_file_path "$passed_phases")"
}

storage_list_cmd "$@"
