Skip to content

Commit 19ad387

Browse files
committed
Print help when --help, -h, or /h are given on windows
1 parent cbef7e9 commit 19ad387

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

bin/elixir.bat

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
@echo off
22
set argc=0
3-
for %%x in (%*) do set /A argc+=1
4-
if %argc%== 0 (
5-
goto documentation
6-
) else (
7-
goto parseopts
3+
for %%A in (%*) do (
4+
if "%%A"=="--help" goto documentation
5+
if "%%A"=="-h" goto documentation
6+
if "%%A"=="/h" goto documentation
7+
set /A argc+=1
88
)
9+
if %argc%==0 goto documentation
10+
goto parseopts
11+
912
:documentation
1013
echo Usage: %~nx0 [options] [.exs file] [data]
1114
echo.

bin/elixirc.bat

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
@echo off
22
set argc=0
3-
for %%x in (%*) do set /A argc+=1
4-
if %argc% == 0 (
5-
goto documentation
6-
) else (
7-
goto run
3+
for %%A in (%*) do (
4+
if "%%A"=="--help" goto documentation
5+
if "%%A"=="-h" goto documentation
6+
if "%%A"=="/h" goto documentation
7+
set /A argc+=1
88
)
9+
if %argc%==0 goto documentation
10+
goto run
11+
912
:documentation
1013
echo Usage: %~nx0 [elixir switches] [compiler switches] [.ex files]
1114
echo.

0 commit comments

Comments
 (0)