mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-11-29 07:10:58 +01:00
Perform CLI argument validation as early as possible
This commit is contained in:
parent
38ae3b56b0
commit
22c73bf3f5
3 changed files with 6 additions and 9 deletions
|
|
@ -1022,6 +1022,8 @@ for option in "${OPTIONS[@]}"; do
|
|||
esac
|
||||
done
|
||||
|
||||
[ "${#ARGUMENTS[@]}" -eq 2 ] || usage 1
|
||||
|
||||
DEFINITION_PATH="${ARGUMENTS[0]}"
|
||||
if [ -z "$DEFINITION_PATH" ]; then
|
||||
usage
|
||||
|
|
@ -1046,9 +1048,6 @@ elif [ "${PREFIX_PATH#/}" = "$PREFIX_PATH" ]; then
|
|||
PREFIX_PATH="${PWD}/${PREFIX_PATH}"
|
||||
fi
|
||||
|
||||
# Fail if number of arguments is not equal to 2
|
||||
[ "${#ARGUMENTS[@]}" -eq 2 ] || usage
|
||||
|
||||
if [ -z "$TMPDIR" ]; then
|
||||
TMP="/tmp"
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue