diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-05-12 16:20:42 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-05-12 16:20:42 -0300 |
commit | 238082d2fe4efa5b83153bba8681c3ad582a07ab (patch) | |
tree | 771df10af2b1129dc7ee29aa6ef45860b1c14f9a | |
parent | 7518602cddaaeb1b931a6b3a46505c427480c40e (diff) | |
download | hydra-238082d2fe4efa5b83153bba8681c3ad582a07ab.tar.gz hydra-238082d2fe4efa5b83153bba8681c3ad582a07ab.tar.bz2 |
Syntax check on hydras
-rwxr-xr-x | hydras | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 $* |