diff --git a/build.cmd b/build.cmd index d8a22ef464f32a..c02fd0a1bda46f 100644 --- a/build.cmd +++ b/build.cmd @@ -1,15 +1,8 @@ @echo off +setlocal -if "%~1"=="-h" goto help -if "%~1"=="-help" goto help -if "%~1"=="-?" goto help -if "%~1"=="/?" goto help +set _args="%*" +if "%~1"=="-?" set _args="-help" -powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0eng\build.ps1" %* -goto end - -:help -powershell -ExecutionPolicy ByPass -NoProfile -Command "& { . '%~dp0eng\build.ps1'; Get-Help }" - -:end +powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0eng\build.ps1" %_args% exit /b %ERRORLEVEL% diff --git a/coreclr.cmd b/coreclr.cmd index 83001a52f8ddbd..b513bef6036993 100644 --- a/coreclr.cmd +++ b/coreclr.cmd @@ -1,2 +1,7 @@ @echo off -"%~dp0build.cmd" -subsetCategory coreclr %* +setlocal + +set _args="-subsetCategory coreclr %*" +if "%~1"=="-?" set _args="-help" + +"%~dp0build.cmd" %_args% diff --git a/eng/build.ps1 b/eng/build.ps1 index efd3ce99d5aa53..173826b24ccb47 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -1,5 +1,6 @@ [CmdletBinding(PositionalBinding=$false)] Param( + [switch][Alias('h')]$help, [switch][Alias('b')]$build, [switch][Alias('t')]$test, [switch]$buildtests, @@ -57,6 +58,11 @@ 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 diff --git a/installer.cmd b/installer.cmd index ad9e5312600a23..19cec45042e613 100644 --- a/installer.cmd +++ b/installer.cmd @@ -1,2 +1,7 @@ @echo off -"%~dp0build.cmd" -subsetCategory installer %* \ No newline at end of file +setlocal + +set _args="-subsetCategory installer %*" +if "%~1"=="-?" set _args="-help" + +"%~dp0build.cmd" %_args% diff --git a/libraries.cmd b/libraries.cmd index 6bd85489a2da6b..fadc263ea5585e 100644 --- a/libraries.cmd +++ b/libraries.cmd @@ -1,2 +1,7 @@ @echo off -"%~dp0build.cmd" -subsetCategory libraries %* \ No newline at end of file +setlocal + +set _args="-subsetCategory libraries %*" +if "%~1"=="-?" set _args="-help" + +"%~dp0build.cmd" %_args%