aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhydras13
1 files changed, 12 insertions, 1 deletions
diff --git a/hydras b/hydras
index 2351316..6810898 100755
--- a/hydras
+++ b/hydras
@@ -21,20 +21,31 @@
# Basename configuration
BASENAME="`basename $0`"
-if [ -z "$1" ]; then
+function usage {
echo "usage: $BASENAME <hydra1> [<hydra2> ... <hydraN>] -- <command>"
+ exit 1
+}
+
+if [ -z "$1" ]; then
+ usage
fi
for param in $*; do
shift
if [ "$param" == "--" ]; then
+ has_delimiter="1"
break
fi
hydras="$hydras $param"
done
+if [ -z "$has_delimiter" ]; then
+ echo "missing command delimiter --"
+ usage
+fi
+
for hydra in $hydras; do
echo "Issuing $* on hydra $hydra..."
hydra $hydra $*