From 4aee1f9cf5c46f56c12181f3c1bcb84466b6789c Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sat, 8 Aug 2015 11:04:55 +0100 Subject: scripts: Allow -help to be specified in any argument Allow the -help command line argument to be specified in any argument and not just as the first. --- projects/build-openssl.bat | 13 ++++++++----- projects/build-wolfssl.bat | 11 +++++++---- projects/checksrc.bat | 12 ++++++++---- projects/generate.bat | 11 ++++++----- 4 files changed, 29 insertions(+), 18 deletions(-) (limited to 'projects') diff --git a/projects/build-openssl.bat b/projects/build-openssl.bat index 409c5da38..e2bcf751e 100644 --- a/projects/build-openssl.bat +++ b/projects/build-openssl.bat @@ -27,12 +27,9 @@ rem *************************************************************************** setlocal set VC_VER= set BUILD_PLATFORM= - - rem Display the help + + rem Ensure we have the required arguments if /i "%~1" == "" goto syntax - if /i "%~1" == "-?" goto syntax - if /i "%~1" == "-h" goto syntax - if /i "%~1" == "-help" goto syntax :parseArgs if "%~1" == "" goto prerequisites @@ -81,6 +78,12 @@ rem *************************************************************************** set BUILD_CONFIG=debug ) else if /i "%~1%" == "release" ( set BUILD_CONFIG=release + ) else if /i "%~1" == "-?" ( + goto syntax + ) else if /i "%~1" == "-h" ( + goto syntax + ) else if /i "%~1" == "-help" ( + goto syntax ) else ( if not defined START_DIR ( set START_DIR=%~1% diff --git a/projects/build-wolfssl.bat b/projects/build-wolfssl.bat index 53188e853..ad755e937 100644 --- a/projects/build-wolfssl.bat +++ b/projects/build-wolfssl.bat @@ -30,11 +30,8 @@ rem *************************************************************************** set VC_VER= set BUILD_PLATFORM= - rem Display the help + rem Ensure we have the required arguments if /i "%~1" == "" goto syntax - if /i "%~1" == "-?" goto syntax - if /i "%~1" == "-h" goto syntax - if /i "%~1" == "-help" goto syntax :parseArgs if "%~1" == "" goto prerequisites @@ -67,6 +64,12 @@ rem *************************************************************************** set BUILD_CONFIG=debug ) else if /i "%~1" == "release" ( set BUILD_CONFIG=release + ) else if /i "%~1" == "-?" ( + goto syntax + ) else if /i "%~1" == "-h" ( + goto syntax + ) else if /i "%~1" == "-help" ( + goto syntax ) else ( if not defined START_DIR ( set START_DIR=%~1 diff --git a/projects/checksrc.bat b/projects/checksrc.bat index 8a2f63af2..37dc808a9 100644 --- a/projects/checksrc.bat +++ b/projects/checksrc.bat @@ -26,10 +26,14 @@ rem *************************************************************************** if not "%OS%" == "Windows_NT" goto nodos setlocal - rem Display the help - if /i "%~1" == "-?" goto syntax - if /i "%~1" == "-h" goto syntax - if /i "%~1" == "-help" goto syntax +:parseArgs + if /i "%~1" == "-?" ( + goto syntax + ) else if /i "%~1" == "-h" ( + goto syntax + ) else if /i "%~1" == "-help" ( + goto syntax + ) :prerequisites rem Check we have Perl installed diff --git a/projects/generate.bat b/projects/generate.bat index de4ff4dfb..36778e810 100644 --- a/projects/generate.bat +++ b/projects/generate.bat @@ -58,11 +58,6 @@ rem If you need to set the errorlevel do this instead: CALL :seterr [#] gzip --version NUL 2>&1 if %ERRORLEVEL% equ 0 (set HAVE_GZIP=Y) else (set HAVE_GZIP=) - rem Display the help - if /i "%~1" == "-?" goto syntax - if /i "%~1" == "-h" goto syntax - if /i "%~1" == "-help" goto syntax - :parseArgs if "%~1" == "" goto start @@ -86,6 +81,12 @@ rem If you need to set the errorlevel do this instead: CALL :seterr [#] set VERSION=VC14 ) else if /i "%~1" == "-clean" ( set MODE=CLEAN + ) else if /i "%~1" == "-?" ( + goto syntax + ) else if /i "%~1" == "-h" ( + goto syntax + ) else if /i "%~1" == "-help" ( + goto syntax ) else ( goto unknown ) -- cgit v1.2.3