xxx.bat --tag=dev1010 --context=3 --cpu=3 --memory=3 --build=1 --update=1 --api-version=1
@echo off
setlocal
set COMMANSLINE="%*"
:STR_VISTOR
for /f "tokens=1,*" %%a in (%COMMANSLINE%) do (
rem 在这里添加不同的参数
for /f "tokens=1,* delims==;" %%1 in ("%%a") do (
if "%%1"=="--tag" (
set tag=%%2
)
if "%%1"=="--context" (
set context=%%2
)
if "%%1"=="--cpu" (
set cpu=%%2
)
if "%%1"=="--memory" (
set memory=%%2
)
if "%%1"=="--build" (
set build=%%2
)
if "%%1"=="--update" (
set update=%%2
)
if "%%1"=="--api-version" (
set api-version=%%2
)
)
set COMMANSLINE="%%b"
goto STR_VISTOR
)
echo tag=%tag%
echo context=%context%
echo cpu=%cpu%
echo memory=%memory%
echo build=%build%
echo update=%update%
echo api-version=%api-version%