Last active
December 16, 2016 00:58
-
-
Save gusg21/5d832d8877e1f246bb739630215254aa to your computer and use it in GitHub Desktop.
Eggnog Argument Parser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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