improve error text when option is used without value - fixes #519

Sun, 15 Dec 2024 14:45:53 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 15 Dec 2024 14:45:53 +0100
changeset 127
33bc4ae5d7cf
parent 126
c82d46627c72
child 128
22f7262475e7

improve error text when option is used without value - fixes #519

src/main/resources/make/configure.vm file | annotate | diff | comparison | revisions
test/configure file | annotate | diff | comparison | revisions
test/configure2 file | annotate | diff | comparison | revisions
test/make/configure.vm file | annotate | diff | comparison | revisions
--- a/src/main/resources/make/configure.vm	Sun Dec 15 14:35:58 2024 +0100
+++ b/src/main/resources/make/configure.vm	Sun Dec 15 14:45:53 2024 +0100
@@ -207,11 +207,12 @@
         "--infodir="*)        infodir=${D}{ARG#--infodir=} ;;
         "--mandir"*)          mandir=${D}{ARG#--mandir} ;;
         "--localedir"*)       localedir=${D}{ARG#--localedir} ;;
-        "--help"*) printhelp; abort_configure ;;
-        "--debug")           BUILD_TYPE="debug" ;;
-        "--release")         BUILD_TYPE="release" ;;
+        "--help"*)            printhelp; abort_configure ;;
+        "--debug")            BUILD_TYPE="debug" ;;
+        "--release")          BUILD_TYPE="release" ;;
     #foreach( $opt in $options )
         "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;;
+        "--${opt.argument}")  echo "option '$ARG' needs a value:"; echo "  $ARG=${opt.valuesString}"; abort_configure ;;
     #end
     #foreach( $feature in $features )
         "--enable-${feature.arg}") ${feature.varName}=on ;;
--- a/test/configure	Sun Dec 15 14:35:58 2024 +0100
+++ b/test/configure	Sun Dec 15 14:45:53 2024 +0100
@@ -186,9 +186,9 @@
         "--infodir="*)        infodir=${ARG#--infodir=} ;;
         "--mandir"*)          mandir=${ARG#--mandir} ;;
         "--localedir"*)       localedir=${ARG#--localedir} ;;
-        "--help"*) printhelp; abort_configure ;;
-        "--debug")           BUILD_TYPE="debug" ;;
-        "--release")         BUILD_TYPE="release" ;;
+        "--help"*)            printhelp; abort_configure ;;
+        "--debug")            BUILD_TYPE="debug" ;;
+        "--release")          BUILD_TYPE="release" ;;
         "--enable-pg") FEATURE_PG=on ;;
         "--disable-pg") unset FEATURE_PG ;;
         "-"*) echo "unknown option: $ARG"; abort_configure ;;
--- a/test/configure2	Sun Dec 15 14:35:58 2024 +0100
+++ b/test/configure2	Sun Dec 15 14:45:53 2024 +0100
@@ -181,10 +181,11 @@
         "--infodir="*)        infodir=${ARG#--infodir=} ;;
         "--mandir"*)          mandir=${ARG#--mandir} ;;
         "--localedir"*)       localedir=${ARG#--localedir} ;;
-        "--help"*) printhelp; abort_configure ;;
-        "--debug")           BUILD_TYPE="debug" ;;
-        "--release")         BUILD_TYPE="release" ;;
+        "--help"*)            printhelp; abort_configure ;;
+        "--debug")            BUILD_TYPE="debug" ;;
+        "--release")          BUILD_TYPE="release" ;;
         "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;;
+        "--toolkit")  echo "option '$ARG' needs a value:"; echo "  $ARG=(gtk3|cli|gtk2|wpf)"; abort_configure ;;
         "--enable-db") FEATURE_DB=on ;;
         "--disable-db") unset FEATURE_DB ;;
         "--enable-gui") FEATURE_GUI=on ;;
--- a/test/make/configure.vm	Sun Dec 15 14:35:58 2024 +0100
+++ b/test/make/configure.vm	Sun Dec 15 14:45:53 2024 +0100
@@ -207,11 +207,12 @@
         "--infodir="*)        infodir=${D}{ARG#--infodir=} ;;
         "--mandir"*)          mandir=${D}{ARG#--mandir} ;;
         "--localedir"*)       localedir=${D}{ARG#--localedir} ;;
-        "--help"*) printhelp; abort_configure ;;
-        "--debug")           BUILD_TYPE="debug" ;;
-        "--release")         BUILD_TYPE="release" ;;
+        "--help"*)            printhelp; abort_configure ;;
+        "--debug")            BUILD_TYPE="debug" ;;
+        "--release")          BUILD_TYPE="release" ;;
     #foreach( $opt in $options )
         "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;;
+        "--${opt.argument}")  echo "option '$ARG' needs a value:"; echo "  $ARG=${opt.valuesString}"; abort_configure ;;
     #end
     #foreach( $feature in $features )
         "--enable-${feature.arg}") ${feature.varName}=on ;;

mercurial