Skip to content

Commit

Permalink
new logic of :popars for trimming spaces between arguments
Browse files Browse the repository at this point in the history
prev. variant cbaa97b also affects on equal sign (=) that's incorrect to final arguments.
  • Loading branch information
3F committed May 19, 2017
1 parent 594b7ca commit 13362b5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions frontend.bat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ set ERROR_SUCCESS=0
set ERROR_FILE_NOT_FOUND=2
set ERROR_PATH_NOT_FOUND=3

:: leave for this at least 1 trailing whitespace -v
set "args=%* "


Expand Down Expand Up @@ -107,10 +106,6 @@ exit /B 0

if "%args: =%"=="" (
goto action
) else (
set _args=%args%
for /f "tokens=* delims=-" %%a in ('echo %args%') do set args=%%a
if "!_args:~0,1!"=="-" set args=-!args!
)

set /a idx=1 & set cmdMax=12
Expand Down Expand Up @@ -184,8 +179,17 @@ goto action

:popars
set args=!!args:%1 ^=!!
call :trim args
set "args=!args! "
exit /B 0

:trim
call :_v %%%1%%
set %1=%_trimv%
exit /B 0
:_v
set "_trimv=%*"
exit /B 0

:action
::::
Expand Down

0 comments on commit 13362b5

Please sign in to comment.