From ae6744a5a851f07d6ae76222529aae38447c832a Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 24 Sep 2020 14:27:24 +0200 Subject: [PATCH] Print help for -? and /? cross-plat (#42396) * Print help for -? and /? cross-plat --- build.cmd | 1 + eng/build.ps1 | 2 +- eng/build.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.cmd b/build.cmd index 76f4d8418947e..fd4aba34c4c92 100644 --- a/build.cmd +++ b/build.cmd @@ -3,6 +3,7 @@ setlocal set _args=%* if "%~1"=="-?" set _args=-help +if "%~1"=="/?" set _args=-help powershell -ExecutionPolicy ByPass -NoProfile -Command "& '%~dp0eng\build.ps1'" %_args% exit /b %ERRORLEVEL% diff --git a/eng/build.ps1 b/eng/build.ps1 index 016ed15d2035a..393ed8456de44 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -103,7 +103,7 @@ function Get-Help() { Write-Host "For more information, check out https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md" } -if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) { +if ($help) { Get-Help exit 0 } diff --git a/eng/build.sh b/eng/build.sh index 47c02964f1e61..bbd1ac3eb582d 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -172,7 +172,7 @@ while [[ $# > 0 ]]; do firstArgumentChecked=1 case "$opt" in - -help|-h) + -help|-h|-\?|/?) usage exit 0 ;;