mirror of
https://github.com/skywind3000/z.lua
synced 2026-03-20 22:59:47 +00:00
add echo pwd
This commit is contained in:
11
z.cmd
11
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
|
||||
|
||||
Reference in New Issue
Block a user