Skip to content

Commit f207791

Browse files
committed
Added debug text and fixed --update flag
1 parent aa9692d commit f207791

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

batch encoder.bat

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,22 @@ set "formatend="
1919
rem if FLAG, record the flag name
2020
echo !ARG! | findstr "\--" > nul && (
2121
if not ["!FLAG!"]==["0"] ( rem Check if FLAG is set - if it is, then previous was a boolean.
22-
set "!FLAG!=true"
22+
set "par_!FLAG!=true"
23+
echo %iconyellow%par_!FLAG!=TRUE%formatend%
2324
)
2425
set ARG_NAME=!ARG:~2!
2526
set "FLAG=!ARG_NAME!"
27+
echo %iconyellow%FLAG=!ARG_NAME!%formatend%
2628
) || (
2729
set "par_!FLAG!=!ARG!"
30+
echo %iconyellow%par_!FLAG!=!ARG!%formatend%
2831
set "FLAG=0"
2932
)
3033
)
3134

3235
if not ["!FLAG!"]==["0"] ( rem Final boolean catch
3336
set "par_!FLAG!=true"
37+
echo %iconyellow%par_!FLAG!=TRUE%formatend%
3438
)
3539

3640

@@ -41,9 +45,7 @@ if defined par_updated-from (
4145
del "%par_updated-from:"=%"
4246
)
4347

44-
echo %par_silent%
45-
pause
46-
48+
pause rem remove
4749

4850
:AskProceed
4951
call:ClearAndTitle
@@ -56,8 +58,11 @@ pause
5658

5759
:AskUpdate
5860
call:ClearAndTitle
59-
if %par_silent%==true (
61+
if /i %par_silent%==true (
6062
if not defined par_update (echo Error: --silent switch used but --update [true/false] not provided. & exit /b 1)
63+
if /i %par_update%==false (goto FFMPEGLocation)
64+
if /i %par_update%==true (goto AutoUpdate)
65+
echo Error: --update argument invalid ^(should be [true/false]^). & exit /b 1
6166
)
6267
set /p "updateconfirmation=%icongray% ^ %formatend% Would you like to check for an update? %textgray%[Y/N]%formatend%: "
6368
if /i "%updateconfirmation%"=="n" (goto FFMPEGLocation)

0 commit comments

Comments
 (0)