From 3bd87dc46ff202ee3d37e9d5e3e0c5ebfe504bba Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Wed, 27 May 2020 21:43:53 +0200 Subject: cgit-chroot: Add usage --- cgit-chroot | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cgit-chroot') 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 -- cgit v1.2.3-2-gb3c3