[Xymon] [PATCH] configure: error on unknown arg

Ken Dreyer kdreyer at usgs.gov
Thu May 22 20:39:44 CEST 2014


Prior to this commit, if a user ran configure with an unrecognized
argument, the configure script would silently fail.

Handle the case of unknown arguments by printing an error and exiting
with a non-zero exit code.
---
 configure | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure b/configure
index 9173658..4b97fed 100755
--- a/configure
+++ b/configure
@@ -15,15 +15,22 @@ chmod 755 $BASEDIR/configure* $BASEDIR/build/*.sh $BASEDIR/client/*.sh
 case "$TARGET" in
   "--client")
 	$BASEDIR/configure.client $*
+  	exit 0
 	;;
 
   "--server"|"")
 	$BASEDIR/configure.server $*
+  	exit 0
 	;;
 
   "--help")
   	echo "To configure a Xymon server: $0 --server"
   	echo "To configure a Xymon client: $0 --client"
+  	exit 0
+	;;
+  *)
+  	echo "unrecognized $0 target $TARGET"
+  	exit 1
 	;;
 esac
 
-- 
1.9.0




More information about the Xymon mailing list