Check scripts params.

This commit is contained in:
onovy 2015-03-29 17:57:06 +02:00
parent 60f242e2ae
commit 0722b25c03
2 changed files with 14 additions and 1 deletions

View File

@ -104,6 +104,7 @@ function Usage
echo "--dry Will run osync without actually doing anything; just testing"
echo "--silent Will run osync without any output to stdout, used for cron jobs"
echo "--verbose Increases output"
exit 128
}
silent=0
@ -136,7 +137,10 @@ do
;;
--help|-h)
Usage
exit 0
;;
*)
Log "Unknown param '$i'"
Usage
;;
esac
done

View File

@ -2040,6 +2040,7 @@ then
Usage
fi
first=1
for i in "$@"
do
case $i in
@ -2100,7 +2101,15 @@ do
--no-locks)
nolocks=1
;;
*)
if [ $first == "0" ]
then
LogError "Unknown option '$i'"
Usage
fi
;;
esac
first=0
done
# Remove leading space if there is one