diff options
Diffstat (limited to 'win32/test_shellsplit.cmd')
| -rw-r--r-- | win32/test_shellsplit.cmd | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/win32/test_shellsplit.cmd b/win32/test_shellsplit.cmd new file mode 100644 index 0000000000..8a2e8ec8f4 --- /dev/null +++ b/win32/test_shellsplit.cmd @@ -0,0 +1,28 @@ +@echo off & if not [%1]==[] goto :process
+
+echo.
+echo This script demonstrates how shellsplit.cmd works.
+echo usage: %0 arg1 arg2...
+echo.
+echo Prints separated arguments as (arg1)(arg2)...
+echo - splits commandline with spaces/tabs. cmd.exe standard rule is ignored.
+echo - you can use double quotes to contain spaces/tabs into an argument.
+echo - you can not escape double quote.
+echo - solitary "" is ignored since cmd.exe variables cannot represent empty value.
+exit /b 0
+
+:process
+setlocal
+set V=0
+
+:: %* can contain meta character inside quote. do not use set "args=%*" here.
+set args=%*
+
+:loop
+call %~dp0\shellsplit.cmd
+if not defined argv goto :end
+set /p "tmp=(%argv%)"<NUL
+goto :loop
+
+:end
+endlocal & exit /b 0
|
