trees: unified handling of flags

this way, the error message will never be incorrect,
which i had to fix in a recent patch.

now, the same string is used for error messages and getopt.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-04-12 02:18:15 +01:00
parent 3ea633cc79
commit 115a66fddd
+3 -3
View File
@@ -15,15 +15,15 @@ eval "`setvars "" xarch srcdir premake gnatdir xlang mode makeargs elfdir cmd \
defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs gccver gccfull \
gnatver gnatfull gccdir cmakedir do_make badhash`"
flags="-m/-u/-b/-c/-x/-f/-s/-l/-n/-d"
main()
{
flags="f:b:m:u:c:x:s:l:n:d:"
[ $# -lt 1 ] && $err "No argument provided"
[ "${1%-*}" = "$1" ] && $err \
"First argument must be a flag ($flags)"
while getopts f:b:m:u:c:x:s:l:n:d: option; do
while getopts $flags option; do
[ -n "$_f" ] && $err "only one flag is permitted"
_f="$1"