configure: show help for bad option
authorJens Axboe <axboe@kernel.dk>
Thu, 24 Jan 2013 17:34:14 +0000 (10:34 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 24 Jan 2013 17:34:14 +0000 (10:34 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
configure

index 9273449233b0bc8553debfb7fa9d97b29d85a501..af2c1d97f6667aa20a4de571b09abc022e3fe3df 100755 (executable)
--- a/configure
+++ b/configure
@@ -104,6 +104,8 @@ cc="${CC-${cross_prefix}gcc}"
 
 # default options
 gfio="no"
+show_help="no"
+exit_val=0
 
 # parse options
 for opt do
@@ -116,16 +118,21 @@ for opt do
     gfio="yes"
     ;;
   --help)
-    echo "--cc=                  Specify compiler to use"
-    echo "--enable-gfio          Enable building of gtk gfio"
-    exit 0
+    show_help="yes"
     ;;
   *)
   echo "Bad option $opt"
-  exit 1
+  show_help="yes"
+  exit_val=1
   esac
 done
 
+if test "$show_help" = "yes" ; then
+    echo "--cc=                  Specify compiler to use"
+    echo "--enable-gfio          Enable building of gtk gfio"
+    exit $exit_val
+fi
+
 if check_define __linux__ ; then
   targetos="Linux"
 elif check_define __OpenBSD__ ; then