@echo off
REM ============================================================
REM  T06 - Parametri mancanti / parsing
REM  Attesi:
REM    a) manca -azione   -> -101 (NRE in ArgParser, vedi criticita C7)
REM    b) manca -ip       -> -102 parametri mancanti
REM    c) manca -pathprogramma -> -102 (richiesto ANCHE per Scarica)
REM    d) -help           -> 0, stampa guida
REM  NON usa rete: testabili anche offline.
REM ============================================================
setlocal
call "%~dp0config.bat"
if not exist "%RESULTS%" mkdir "%RESULTS%"
set LOG=%RESULTS%\t06_parametri.log
echo === T06 PARAMETRI MANCANTI === > "%LOG%"

echo. >> "%LOG%"
echo ----- a) manca -azione ----- >> "%LOG%"
"%EXE%" -manufacturer=mitsubishi -ip=%IP% -porta=%PORT% -pathprogramma="%RESULTS%\x.txt" >> "%LOG%" 2>&1
echo EXITCODE_a=%ERRORLEVEL% >> "%LOG%"

echo. >> "%LOG%"
echo ----- b) manca -ip ----- >> "%LOG%"
"%EXE%" -manufacturer=mitsubishi -azione=Scarica -porta=%PORT% -pathprogramma="%RESULTS%\x.txt" >> "%LOG%" 2>&1
echo EXITCODE_b=%ERRORLEVEL% >> "%LOG%"

echo. >> "%LOG%"
echo ----- c) manca -pathprogramma ----- >> "%LOG%"
"%EXE%" -manufacturer=mitsubishi -azione=Scarica -ip=%IP% -porta=%PORT% >> "%LOG%" 2>&1
echo EXITCODE_c=%ERRORLEVEL% >> "%LOG%"

echo. >> "%LOG%"
echo ----- d) -help ----- >> "%LOG%"
"%EXE%" -help >> "%LOG%" 2>&1
echo EXITCODE_d=%ERRORLEVEL% >> "%LOG%"

echo Log: %LOG%
type "%LOG%"
endlocal
