about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMohit Agarwal <mohit@sdf.org>2016-09-01 18:49:35 +0530
committerMohit Agarwal <mohit@sdf.org>2016-09-01 18:49:35 +0530
commit7d5fa9edc9b9784cbde3550826cc0f37aa6c1501 (patch)
tree8d9ee89367aa5730dd23125a7cc8e3e0a3e9242a
parentb2799a56a1631ee351e4687ee649808e28cccda1 (diff)
downloadrust-7d5fa9edc9b9784cbde3550826cc0f37aa6c1501.tar.gz
rust-7d5fa9edc9b9784cbde3550826cc0f37aa6c1501.zip
configure: check if any of the arguments contain --help
Currently it checks only the first argument.

Fixes #31216
-rwxr-xr-xconfigure12
1 files changed, 8 insertions, 4 deletions
diff --git a/configure b/configure
index 44fb3d368d2..bcc1faea3b5 100755
--- a/configure
+++ b/configure
@@ -360,6 +360,13 @@ abs_path() {
     (unset CDPATH && cd "$_path" > /dev/null && pwd)
 }
 
+HELP=0
+for arg; do
+    case "$arg" in
+        --help) HELP=1;;
+    esac
+done
+
 msg "looking for configure programs"
 need_cmd cmp
 need_cmd mkdir
@@ -566,11 +573,8 @@ esac
 
 
 OPTIONS=""
-HELP=0
-if [ "$1" = "--help" ]
+if [ "$HELP" -eq 1 ]
 then
-    HELP=1
-    shift
     echo
     echo "Usage: $CFG_SELF [options]"
     echo