From f3a0dca495d6e4168c325c618721974766ebf291 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Fri, 30 Mar 2018 13:15:00 +0800 Subject: [PATCH] add echo pwd --- z.cmd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/z.cmd b/z.cmd index ec56016..d04d0e1 100644 --- a/z.cmd +++ b/z.cmd @@ -7,6 +7,7 @@ set "MatchType=-n" set "StrictSub=-n" set "ListOnly=-n" set "HelpMode=-n" +set "EchoPath=-n" if /i not "%_ZL_LUA_EXE%"=="" ( set "LuaExe=%_ZL_LUA_EXE%" @@ -39,12 +40,19 @@ if /i "%1"=="-l" ( goto parse ) +if /i "%1"=="-e" ( + set "EchoPath=-e" + shift /1 + goto parse +) + if /i "%1"=="-h" ( call "%LuaExe%" "%LuaScript%" -h shift /1 goto end ) + :check if /i "%1"=="" ( @@ -58,6 +66,9 @@ if /i "%ListOnly%"=="-n" ( for /f "delims=" %%i in ('call "%LuaExe%" "%LuaScript%" --cd %MatchType% %StrictSub% %*') do set "NewPath=%%i" if not "!NewPath!"=="" ( if exist !NewPath!\nul ( + if /i "%EchoPath%"=="-e" ( + echo !NewPath! + ) pushd !NewPath! pushd !NewPath! endlocal