summaryrefslogtreecommitdiff
path: root/localcowbuilder-create
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-01-13 18:26:13 +0000
committerJonas Smedegaard <dr@jones.dk>2008-01-13 18:26:13 +0000
commit16502ec50e23a1c9284b1eaef8ba86d8fd670de2 (patch)
tree2bde21230a425df83e427cd68080b059e459800b /localcowbuilder-create
parent9cf38c2ec99a3fe664a9dc39d19af5f542c19a8d (diff)
Add and use showhelp function.
Diffstat (limited to 'localcowbuilder-create')
-rwxr-xr-xlocalcowbuilder-create20
1 files changed, 15 insertions, 5 deletions
diff --git a/localcowbuilder-create b/localcowbuilder-create
index 90f9d89..896447f 100755
--- a/localcowbuilder-create
+++ b/localcowbuilder-create
@@ -1,11 +1,21 @@
#!/bin/sh
+set -e
+
+PRG=$(basename "$0")
+
+function showhelp() {
+ cat <<EOF
+Usage: $PRG POOL [ DISTRIBUTION [ OTHERMIRROR] ]
+
+Examples:
+ $PRG sarge
+ $PRG sarge+hacks sarge 'deb http://example.com/ sarge hacks'
+EOF
+}
+
if [ $# -eq 0 ]; then
- echo "Usage: $(basename $0) POOL [ DISTRIBUTION [ OTHERMIRROR] ]"
- echo ""
- echo "Examples:"
- echo " $(basename $0) sarge"
- echo " $(basename $0) sarge+hacks sarge 'deb http://example.com/ sarge hacks'"
+ showhelp
exit 1
fi