1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 16:18:48 -05:00

checksrc.bat: Added check for unknown arguments

This commit is contained in:
Steve Holme 2015-08-08 11:21:49 +01:00
parent a8e9e0c205
commit 1ab763acce

View File

@ -29,14 +29,24 @@ rem ***************************************************************************
setlocal setlocal
:parseArgs :parseArgs
if "%~1" == "" goto prerequisites
if /i "%~1" == "-?" ( if /i "%~1" == "-?" (
goto syntax goto syntax
) else if /i "%~1" == "-h" ( ) else if /i "%~1" == "-h" (
goto syntax goto syntax
) else if /i "%~1" == "-help" ( ) else if /i "%~1" == "-help" (
goto syntax goto syntax
) else (
if not defined SRC_DIR (
set SRC_DIR=%~1%
) else (
goto unknown
)
) )
shift & goto parseArgs
:prerequisites :prerequisites
rem Check we have Perl installed rem Check we have Perl installed
echo %PATH% | findstr /I /C:"\Perl" 1>nul echo %PATH% | findstr /I /C:"\Perl" 1>nul
@ -47,8 +57,7 @@ rem ***************************************************************************
) )
:configure :configure
if "%1" == "" set SRC_DIR=.. if "%SRC_DIR%" == "" set SRC_DIR=..
if not "%1" == "" set SRC_DIR=%~1%
if not exist "%SRC_DIR%" goto nosrc if not exist "%SRC_DIR%" goto nosrc
:start :start
@ -74,6 +83,11 @@ rem ***************************************************************************
echo directory - Specifies the curl source directory echo directory - Specifies the curl source directory
goto success goto success
:unknown
echo.
echo Error: Unknown argument '%1'
goto error
:nodos :nodos
echo. echo.
echo Error: Only a Windows NT based Operating System is supported echo Error: Only a Windows NT based Operating System is supported