Commit a3a8bba3 authored by Steve Holme's avatar Steve Holme
Browse files

checksrc.bat: Added support for the examples

parent a8b51a17
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ rem ***************************************************************************
  set CHECK_LIB=TRUE
  set CHECK_SRC=TRUE
  set CHECK_TESTS=TRUE
  set CHECK_EXAMPLES=TRUE

:parseArgs
  if "%~1" == "" goto prerequisites
@@ -44,14 +45,22 @@ rem ***************************************************************************
    set CHECK_LIB=TRUE
    set CHECK_SRC=FALSE
    set CHECK_TESTS=FALSE
    set CHECK_EXAMPLES=FALSE
  ) else if /i "%~1" == "src" (
    set CHECK_LIB=FALSE
    set CHECK_SRC=TRUE
    set CHECK_TESTS=FALSE
    set CHECK_EXAMPLES=FALSE
  ) else if /i "%~1" == "tests" (
    set CHECK_LIB=FALSE
    set CHECK_SRC=FALSE
    set CHECK_TESTS=TRUE
    set CHECK_EXAMPLES=FALSE
  ) else if /i "%~1" == "examples" (
    set CHECK_LIB=FALSE
    set CHECK_SRC=FALSE
    set CHECK_TESTS=FALSE
    set CHECK_EXAMPLES=TRUE
  ) else (
    if not defined SRC_DIR (
      set SRC_DIR=%~1%
@@ -131,6 +140,13 @@ rem ***************************************************************************
    )
  )

  if "%CHECK_EXAMPLES%" == "TRUE" (
    rem Check the docs\examples directory
    if exist %SRC_DIR%\docs\examples (
      for /f "delims=" %%i in ('dir "%SRC_DIR%\docs\examples\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\docs\examples" "%%i"
    )
  )

  goto success

:syntax
@@ -143,6 +159,7 @@ rem ***************************************************************************
  echo lib       - Scan the libcurl source
  echo src       - Scan the command-line tool source
  echo tests     - Scan the library tests and unit tests
  echo examples  - Scan the examples
  echo.
  echo directory - Specifies the curl source directory
  goto success