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.
This commit is contained in:
parent
b9b7ccd04a
commit
4aee1f9cf5
@ -30,11 +30,6 @@ rem This file is not included or required for curl's release archives or daily
|
|||||||
rem snapshot archives.
|
rem snapshot archives.
|
||||||
|
|
||||||
:begin
|
:begin
|
||||||
rem Display the help
|
|
||||||
if /i "%~1" == "-?" goto syntax
|
|
||||||
if /i "%~1" == "-h" goto syntax
|
|
||||||
if /i "%~1" == "-help" goto syntax
|
|
||||||
|
|
||||||
rem Switch to this batch file's directory
|
rem Switch to this batch file's directory
|
||||||
cd /d "%~0\.." 1>NUL 2>&1
|
cd /d "%~0\.." 1>NUL 2>&1
|
||||||
|
|
||||||
@ -50,6 +45,12 @@ rem snapshot archives.
|
|||||||
|
|
||||||
if /i "%~1" == "-clean" (
|
if /i "%~1" == "-clean" (
|
||||||
set MODE=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 (
|
) else (
|
||||||
goto unknown
|
goto unknown
|
||||||
)
|
)
|
||||||
|
@ -28,11 +28,8 @@ rem ***************************************************************************
|
|||||||
set VC_VER=
|
set VC_VER=
|
||||||
set BUILD_PLATFORM=
|
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" == "-?" goto syntax
|
|
||||||
if /i "%~1" == "-h" goto syntax
|
|
||||||
if /i "%~1" == "-help" goto syntax
|
|
||||||
|
|
||||||
:parseArgs
|
:parseArgs
|
||||||
if "%~1" == "" goto prerequisites
|
if "%~1" == "" goto prerequisites
|
||||||
@ -81,6 +78,12 @@ rem ***************************************************************************
|
|||||||
set BUILD_CONFIG=debug
|
set BUILD_CONFIG=debug
|
||||||
) else if /i "%~1%" == "release" (
|
) else if /i "%~1%" == "release" (
|
||||||
set BUILD_CONFIG=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 (
|
) else (
|
||||||
if not defined START_DIR (
|
if not defined START_DIR (
|
||||||
set START_DIR=%~1%
|
set START_DIR=%~1%
|
||||||
|
@ -30,11 +30,8 @@ rem ***************************************************************************
|
|||||||
set VC_VER=
|
set VC_VER=
|
||||||
set BUILD_PLATFORM=
|
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" == "-?" goto syntax
|
|
||||||
if /i "%~1" == "-h" goto syntax
|
|
||||||
if /i "%~1" == "-help" goto syntax
|
|
||||||
|
|
||||||
:parseArgs
|
:parseArgs
|
||||||
if "%~1" == "" goto prerequisites
|
if "%~1" == "" goto prerequisites
|
||||||
@ -67,6 +64,12 @@ rem ***************************************************************************
|
|||||||
set BUILD_CONFIG=debug
|
set BUILD_CONFIG=debug
|
||||||
) else if /i "%~1" == "release" (
|
) else if /i "%~1" == "release" (
|
||||||
set BUILD_CONFIG=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 (
|
) else (
|
||||||
if not defined START_DIR (
|
if not defined START_DIR (
|
||||||
set START_DIR=%~1
|
set START_DIR=%~1
|
||||||
|
@ -26,10 +26,14 @@ rem ***************************************************************************
|
|||||||
if not "%OS%" == "Windows_NT" goto nodos
|
if not "%OS%" == "Windows_NT" goto nodos
|
||||||
setlocal
|
setlocal
|
||||||
|
|
||||||
rem Display the help
|
:parseArgs
|
||||||
if /i "%~1" == "-?" goto syntax
|
if /i "%~1" == "-?" (
|
||||||
if /i "%~1" == "-h" goto syntax
|
goto syntax
|
||||||
if /i "%~1" == "-help" goto syntax
|
) else if /i "%~1" == "-h" (
|
||||||
|
goto syntax
|
||||||
|
) else if /i "%~1" == "-help" (
|
||||||
|
goto syntax
|
||||||
|
)
|
||||||
|
|
||||||
:prerequisites
|
:prerequisites
|
||||||
rem Check we have Perl installed
|
rem Check we have Perl installed
|
||||||
|
@ -58,11 +58,6 @@ rem If you need to set the errorlevel do this instead: CALL :seterr [#]
|
|||||||
gzip --version <NUL 1>NUL 2>&1
|
gzip --version <NUL 1>NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 (set HAVE_GZIP=Y) else (set HAVE_GZIP=)
|
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
|
:parseArgs
|
||||||
if "%~1" == "" goto start
|
if "%~1" == "" goto start
|
||||||
|
|
||||||
@ -86,6 +81,12 @@ rem If you need to set the errorlevel do this instead: CALL :seterr [#]
|
|||||||
set VERSION=VC14
|
set VERSION=VC14
|
||||||
) else if /i "%~1" == "-clean" (
|
) else if /i "%~1" == "-clean" (
|
||||||
set MODE=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 (
|
) else (
|
||||||
goto unknown
|
goto unknown
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user