Skip to content

Instantly share code, notes, and snippets.

@gusg21
Last active December 16, 2016 00:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gusg21/5d832d8877e1f246bb739630215254aa to your computer and use it in GitHub Desktop.
Save gusg21/5d832d8877e1f246bb739630215254aa to your computer and use it in GitHub Desktop.
Eggnog Argument Parser
REM EggNog Argument Parser
REM by gusg21
REM Reset ERRORLEVEL
ver > nul
REM Call argument 1 case
2>NUL CALL :c_%1
REM If nonexistent call default
IF ERRORLEVEL 1 CALL :c_def
goto :eof
:c_--arg1
REM --arg1 Case
echo arg1 passed!
goto :eof
:c_--arg2
REM --arg2 Case
echo arg2 passed!
goto :eof
:c_--help
REM Help Case
REM One could also try "type help.txt" or the likes
echo Help:
echo eggnog --arg1
echo eggnog --arg2
goto :eof
:c_def
REM The Default Case
goto c_--help
goto :eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment