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

cmd-plugin-disable() {
  declare desc="disables plugin via command line"
  declare cmd="plugin:disable"
  [[ "$1" == "$cmd" ]] && shift 1
  declare PLUGIN="$1"

  [[ -z "$PLUGIN" ]] && dokku_log_fail "Please specify a plugin to disable"
  disable_plugin "$PLUGIN"
  plugin_prime_bash_completion
}

cmd-plugin-disable "$@"
