-if [%bin%] == [true] (
- if exist "%__RootBinDir%" (
- echo Deleting bin directory
- rd /s /q "%__RootBinDir%"
- if NOT [!ERRORLEVEL!]==[0] (
- echo ERROR: An error occurred while deleting the bin directory - error code is !ERRORLEVEL!
- exit /b 1
- )
- )
-)
-
-if [%tools%] == [true] (
- if exist "%__ProjectDir%\Tools" (
- echo Deleting tools directory
- rd /s /q "%__ProjectDir%\Tools"
- if NOT [!ERRORLEVEL!]==[0] (
- echo ERROR: An error occurred while deleting the Tools directory - error code is !ERRORLEVEL!
- exit /b 1
- )
- )
-)
-
-if [%packages%] == [true] (
- if exist "%__ProjectDir%\packages" (
- echo Deleting packages directory
- rd /s /q "%__ProjectDir%\packages"
- if NOT [!ERRORLEVEL!]==[0] (
- echo ERROR: An error occurred while deleting the packages directory - error code is !ERRORLEVEL!
- exit /b 1
- )
- )
-)
-
-if [%all%] == [true] (
+:: Strip all dashes off the argument and use invariant
+:: compare to match as many versions of "all" that we can
+:: All other argument validation happens inside Run.exe
+if not defined NO_DASHES_ARG goto no_args
+if /I [%NO_DASHES_ARG:-=%] == [all] (