Stricter checks for proper usage

This commit is contained in:
Pierre Pronchery 2014-11-12 21:55:07 +01:00
parent f2325e6ecb
commit daba0a1198

View File

@ -61,10 +61,19 @@ if [ $# -eq 0 ]; then
exit $?
fi
while [ $# -gt 0 ]; do
if [ $# -eq 1 -a -n "$output" ]; then
target="$1"
output="${target%.cpp}.o"
shift
LD_LIBRARY_PATH="../src" $CPP "$target" > "$output"
done
elif [ $# -gt 1 -a -z "$output" ]; then
while [ $# -gt 0 ]; do
target="$1"
output="${target%.cpp}.o"
shift
LD_LIBRARY_PATH="../src" $CPP "$target" > "$output"
done
else
_usage
exit $?
fi