aboutsummaryrefslogtreecommitdiffstats
path: root/cgit-chroot
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xcgit-chroot8
1 files changed, 7 insertions, 1 deletions
diff --git a/cgit-chroot b/cgit-chroot
index 1828ee5..5d229db 100755
--- a/cgit-chroot
+++ b/cgit-chroot
@@ -5,6 +5,11 @@ set -e
CGIT_CHROOT=${CGIT_CHROOT:-/srv/cgit}
CGIT_GIT_ROOT=${CGIT_GIT_ROOT:-/srv/git}
+usage() {
+ printf 'usage: cgit-chroot setup|teardown\n' >&2
+ exit 1
+}
+
log() {
printf ' %s %s\n' "$1" "$2"
}
@@ -63,9 +68,10 @@ teardown() {
done
}
-test $# -eq 1 || exit 1
+test $# -eq 1 || usage
case $1 in
setup) setup;;
teardown) teardown;;
+ *) usage;;
esac