#!/bin/sh . lib/crates.sh cmd=$1 if [ -z "$cmd" ]; then exit 1 else shift fi case $cmd in apply-crates) crate_apply $@ ;; remove-crate) if crate_removable $1; then crate_remove $1 else echo "crate can't be removed" fi ;; list-crates) for c in ${@:-$(ls crates)}; do crate_info $c done ;; esac