From 19ad38794385a44e1b99f6de5afa6b314983ad7b Mon Sep 17 00:00:00 2001 From: Paul Schoenfelder Date: Thu, 8 May 2014 13:47:47 -0500 Subject: [PATCH] Print help when --help, -h, or /h are given on windows --- bin/elixir.bat | 13 ++++++++----- bin/elixirc.bat | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/bin/elixir.bat b/bin/elixir.bat index 4d440b6a41..7a3ba1b280 100644 --- a/bin/elixir.bat +++ b/bin/elixir.bat @@ -1,11 +1,14 @@ @echo off set argc=0 -for %%x in (%*) do set /A argc+=1 -if %argc%== 0 ( - goto documentation -) else ( - goto parseopts +for %%A in (%*) do ( + if "%%A"=="--help" goto documentation + if "%%A"=="-h" goto documentation + if "%%A"=="/h" goto documentation + set /A argc+=1 ) +if %argc%==0 goto documentation +goto parseopts + :documentation echo Usage: %~nx0 [options] [.exs file] [data] echo. diff --git a/bin/elixirc.bat b/bin/elixirc.bat index c682a3b188..27f2fe89d0 100644 --- a/bin/elixirc.bat +++ b/bin/elixirc.bat @@ -1,11 +1,14 @@ @echo off set argc=0 -for %%x in (%*) do set /A argc+=1 -if %argc% == 0 ( - goto documentation -) else ( - goto run +for %%A in (%*) do ( + if "%%A"=="--help" goto documentation + if "%%A"=="-h" goto documentation + if "%%A"=="/h" goto documentation + set /A argc+=1 ) +if %argc%==0 goto documentation +goto run + :documentation echo Usage: %~nx0 [elixir switches] [compiler switches] [.ex files] echo.