Test for number of script arguments to be 1 after shifting options

pull/11/head
Dominik D. Geyer 12 years ago
parent 9473048fdf
commit 7346b37a0d

@ -46,11 +46,6 @@ shelp () { # Print a message about how to use this script
echo "is specified."
}
if [ -z $1 ]; then
shelp
exit
fi
while getopts b:hp: option
do
case "${option}" in
@ -62,6 +57,11 @@ done
shift $((OPTIND-1)) # Shift the input arguments, so that the input file (last arg) is $1 in the code below
if [ $# -ne 1 ]; then
shelp
exit
fi
# Check for both git and inotifywait and generate an error
# if either don't exist or you cannot run them

Loading…
Cancel
Save