Skip to content

Commit

Permalink
Print help for -? and /? cross-plat (#42396)
Browse files Browse the repository at this point in the history
* Print help for -? and /? cross-plat
  • Loading branch information
ViktorHofer authored Sep 24, 2020
1 parent 7c3d238 commit ae6744a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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%
2 changes: 1 addition & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ while [[ $# > 0 ]]; do
firstArgumentChecked=1

case "$opt" in
-help|-h)
-help|-h|-\?|/?)
usage
exit 0
;;
Expand Down

0 comments on commit ae6744a

Please sign in to comment.