Skip to content

Commit aa9692d

Browse files
committed
(non-functional) partially introduced --silent and --update [true/false] switches
1 parent 59e4981 commit aa9692d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

batch encoder.bat

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ 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-
echo set !FLAG!=true
2322
set "!FLAG!=true"
2423
)
2524
set ARG_NAME=!ARG:~2!
@@ -42,9 +41,13 @@ if defined par_updated-from (
4241
del "%par_updated-from:"=%"
4342
)
4443

44+
echo %par_silent%
45+
pause
46+
4547

4648
:AskProceed
4749
call:ClearAndTitle
50+
if %par_silent%==true (goto AskUpdate)
4851
echo %icongray% i %formatend% This program will aim to encode all .mp4 files in the folder it's placed in and delete the originals.
4952
set /p "startconfirmation=Do you want to proceed? %textgray%[Y/N]%formatend%: "
5053
if /i "%startconfirmation%"=="n" exit
@@ -53,6 +56,9 @@ if defined par_updated-from (
5356

5457
:AskUpdate
5558
call:ClearAndTitle
59+
if %par_silent%==true (
60+
if not defined par_update (echo Error: --silent switch used but --update [true/false] not provided. & exit /b 1)
61+
)
5662
set /p "updateconfirmation=%icongray% ^ %formatend% Would you like to check for an update? %textgray%[Y/N]%formatend%: "
5763
if /i "%updateconfirmation%"=="n" (goto FFMPEGLocation)
5864
if /i "%updateconfirmation%"=="y" (goto AutoUpdate)

0 commit comments

Comments
 (0)