Revert "Fix .cmd scripts help arguments (#1043)" (#1110)
authorJan Kotas <jkotas@microsoft.com>
Sat, 21 Dec 2019 20:54:56 +0000 (12:54 -0800)
committerGitHub <noreply@github.com>
Sat, 21 Dec 2019 20:54:56 +0000 (12:54 -0800)
This reverts commit 0a29c61468f60f815119e52e477d0154351a4abf.

build.cmd
coreclr.cmd
eng/build.ps1
installer.cmd
libraries.cmd

index c02fd0a..d8a22ef 100644 (file)
--- a/build.cmd
+++ b/build.cmd
@@ -1,8 +1,15 @@
 @echo off
-setlocal
 
-set _args="%*"
-if "%~1"=="-?" set _args="-help"
+if "%~1"=="-h" goto help
+if "%~1"=="-help" goto help
+if "%~1"=="-?" goto help
+if "%~1"=="/?" goto help
 
-powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0eng\build.ps1" %_args%
+powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0eng\build.ps1" %*
+goto end
+
+:help
+powershell -ExecutionPolicy ByPass -NoProfile -Command "& { . '%~dp0eng\build.ps1'; Get-Help }"
+
+:end
 exit /b %ERRORLEVEL%
index b513bef..83001a5 100644 (file)
@@ -1,7 +1,2 @@
 @echo off
-setlocal
-
-set _args="-subsetCategory coreclr %*"
-if "%~1"=="-?" set _args="-help"
-
-"%~dp0build.cmd" %_args%
+"%~dp0build.cmd" -subsetCategory coreclr %*
index 173826b..efd3ce9 100644 (file)
@@ -1,6 +1,5 @@
 [CmdletBinding(PositionalBinding=$false)]
 Param(
-  [switch][Alias('h')]$help,
   [switch][Alias('b')]$build,
   [switch][Alias('t')]$test,
   [switch]$buildtests,
@@ -58,11 +57,6 @@ if ($MyInvocation.InvocationName -eq ".") {
   exit 0
 }
 
-if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) {
-  Get-Help
-  exit 0
-}
-
 $subsetCategory = $subsetCategory.ToLowerInvariant()
 
 # VS Test Explorer support for libraries
index 19cec45..ad9e531 100644 (file)
@@ -1,7 +1,2 @@
 @echo off
-setlocal
-
-set _args="-subsetCategory installer %*"
-if "%~1"=="-?" set _args="-help"
-
-"%~dp0build.cmd" %_args%
+"%~dp0build.cmd" -subsetCategory installer %*
\ No newline at end of file
index fadc263..6bd8548 100644 (file)
@@ -1,7 +1,2 @@
 @echo off
-setlocal
-
-set _args="-subsetCategory libraries %*"
-if "%~1"=="-?" set _args="-help"
-
-"%~dp0build.cmd" %_args%
+"%~dp0build.cmd" -subsetCategory libraries %*
\ No newline at end of file