#!/usr/bin/env zsh
DEPENDENCIES+=(docker)
#####################################################################

MAIN() {
	local RESOURCES=(
		container
		image
		volume
		system
		)

	echo.warning "
		this will prune the following docker resources from the
		current machine:
		   (${RESOURCES[@]})

		pruned resources are PERMANENTLY DELETED
	 "

	user.yN 'continue?' || utils.abort

	echo.success "$(
		for RESOURCE in ${RESOURCES[@]}
		do
			echo "${RESOURCE}^:^$(docker ${RESOURCE} prune -f 2>/dev/null | tail -n 1)"
		done | column -ts '^'
	)"
}
