Make error messages more consistent
This commit is contained in:
parent
d930fecc3c
commit
3df841bb99
@ -47,19 +47,19 @@ makeCWrapper() {
|
||||
cmd=$(setEnv "${params[n + 1]}" "${params[n + 2]}")
|
||||
main="$main $cmd"$'\n'
|
||||
n=$((n + 2))
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeBinaryWrapper: $p takes 2 arguments"
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeCWrapper: $p takes 2 arguments"
|
||||
;;
|
||||
--set-default)
|
||||
cmd=$(setDefaultEnv "${params[n + 1]}" "${params[n + 2]}")
|
||||
main="$main $cmd"$'\n'
|
||||
n=$((n + 2))
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeBinaryWrapper: $p takes 2 arguments"
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeCWrapper: $p takes 2 arguments"
|
||||
;;
|
||||
--unset)
|
||||
cmd=$(unsetEnv "${params[n + 1]}")
|
||||
main="$main $cmd"$'\n'
|
||||
n=$((n + 1))
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeBinaryWrapper: $p takes 1 argument"
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeCWrapper: $p takes 1 argument"
|
||||
;;
|
||||
--prefix)
|
||||
cmd=$(setEnvPrefix "${params[n + 1]}" "${params[n + 2]}" "${params[n + 3]}")
|
||||
@ -67,7 +67,7 @@ makeCWrapper() {
|
||||
uses_prefix=1
|
||||
uses_concat3=1
|
||||
n=$((n + 3))
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeBinaryWrapper: $p takes 3 arguments"
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeCWrapper: $p takes 3 arguments"
|
||||
;;
|
||||
--suffix)
|
||||
cmd=$(setEnvSuffix "${params[n + 1]}" "${params[n + 2]}" "${params[n + 3]}")
|
||||
@ -75,21 +75,21 @@ makeCWrapper() {
|
||||
uses_suffix=1
|
||||
uses_concat3=1
|
||||
n=$((n + 3))
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeBinaryWrapper: $p takes 3 arguments"
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeCWrapper: $p takes 3 arguments"
|
||||
;;
|
||||
--add-flags)
|
||||
flags="${params[n + 1]}"
|
||||
flagsBefore="$flagsBefore $flags"
|
||||
n=$((n + 1))
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeBinaryWrapper: $p takes 1 argument"
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeCWrapper: $p takes 1 argument"
|
||||
;;
|
||||
--argv0)
|
||||
argv0=$(escapeStringLiteral "${params[n + 1]}")
|
||||
n=$((n + 1))
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeBinaryWrapper: $p takes 1 argument"
|
||||
[ $n -ge "$length" ] && printf '%s\n' " #error makeCWrapper: $p takes 1 argument"
|
||||
;;
|
||||
*) # Using an error macro, we will make sure the compiler gives an understandable error message
|
||||
printf '%s\n' " #error makeCWrapper did not understand argument ${p}"
|
||||
printf '%s\n' " #error makeCWrapper: Unknown argument '$p'"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user