Created
July 11, 2021 23:33
-
-
Save tinytengu/a57ed70f07e566b26470d5a165bb538d to your computer and use it in GitHub Desktop.
Args parse with flags Batch example
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
:args_loop | |
if "%1"=="-lt" set light_time=%2 | |
if "%1"=="-dt" set dark_time=%2 | |
if "%1"=="-lp" set light_theme=%2 | |
if "%1"=="-dp" set dark_theme=%2 | |
if "%1"=="-path" set path_type=%2 | |
shift /1 | |
shift /1 | |
if not "%1"=="" goto args_loop | |
if "%light_time%"=="" set light_time=08:00:00 | |
if "%dark_time%"=="" set dark_time=16:00:00 | |
if "%light_theme%"=="" set light_theme=themeC.theme | |
if "%dark_theme%"=="" set dark_theme=dark.theme | |
if "%path_type%"=="" set path_type=rel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment