Skip to content

Commit b75b83c

Browse files
committed
Added --debug argument
`--debug` will display all arguments at the beginning prior to the rest of execution
1 parent f1f4071 commit b75b83c

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

batch encoder.bat

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
setlocal enabledelayedexpansion
33

4-
set CurrentVersion=v1.6.3
4+
set CurrentVersion=v1.6.4
55
cls
66

77
set "icongray="
@@ -14,31 +14,35 @@ set "textred="
1414
set "formatend="
1515

1616
:ArgParser
17+
set allargs=%*
18+
rem If debug included in args
19+
if not "%allargs%"=="%allargs:--debug=%" (set "par_debug=true")
20+
1721
set "FLAG=0"
1822
for %%G in (%*) DO (
1923
set ARG=%%G
2024
rem if FLAG, record the flag name
2125
echo !ARG! | findstr "\--" > nul && (
2226
if not ["!FLAG!"]==["0"] ( rem Check if FLAG is set - if it is, then previous was a boolean.
2327
set "par_!FLAG!=true"
24-
echo %iconyellow%par_!FLAG!=TRUE%formatend%
28+
if "%par_debug%"=="true" (echo %iconyellow%par_!FLAG!=TRUE%formatend%)
2529
)
2630
set ARG_NAME=!ARG:~2!
2731
set "FLAG=!ARG_NAME!"
28-
echo %iconyellow%FLAG=!ARG_NAME!%formatend%
32+
if "%par_debug%"=="true" (echo %iconyellow%FLAG=!ARG_NAME!%formatend%)
2933
) || (
3034
set "par_!FLAG!=!ARG!"
31-
echo %iconyellow%par_!FLAG!=!ARG!%formatend%
35+
if "%par_debug%"=="true" (echo %iconyellow%par_!FLAG!=!ARG!%formatend%)
3236
set "FLAG=0"
3337
)
3438
)
3539

3640
if not ["!FLAG!"]==["0"] ( rem Final boolean catch
3741
set "par_!FLAG!=true"
38-
echo %iconyellow%par_!FLAG!=TRUE%formatend%
42+
if "%par_debug%"=="true" (echo %iconyellow%par_!FLAG!=TRUE%formatend%)
3943
)
4044

41-
rem pause
45+
if "%par_debug%"=="true" (pause)
4246
cls
4347

4448
if defined par_updated-from (

0 commit comments

Comments
 (0)