: nply/zoop

commit a2857affb5b0515a31e5b85cf65a42e95220b959
parent c5190798195f1c510cf313d9b572bc2e5f809b7f
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Thu, 9 Apr 2026 02:56:34 +0530

Add command cat

Works similar to the scoop cat command
1 file changed, 18 insertions(+), 2 deletions(-)
M
zoop.cmd
|
20
++++++++++++++++++--
diff --git a/zoop.cmd b/zoop.cmd
@@ -5,8 +5,9 @@ goto :main
 echo Usage: zoop ^<command^> [^<pkg^>]
 echo Available commands are listed below.
 echo.
-echo    search     Search available apps
+echo    cat        Show content of specified manifest.
 echo    list       List installed apps
+echo    search     Search available apps
 goto :eof
 
 :zoop_search

@@ -19,6 +20,18 @@ for /f "usebackq" %%i in (`dir /B /A:D "%SCOOP%\buckets\*" 2^>nul`) do (
 endlocal DisableDelayedExpansion
 goto :eof
 
+:zoop_cat
+setlocal
+for /d %%d in ("%SCOOP%\buckets\*") do (
+    if exist "%%d\bucket\%~1.json" (
+        type "%%d\bucket\%~1.json"
+        exit /b 0
+    )
+)
+
+endlocal
+goto :eof
+
 :zoop_list
 setlocal EnableDelayedExpansion
 rem for /f "usebackq" %%i in (`dir /B /A:D "%SCOOP%\apps\*" 2^>nul`) do (

@@ -38,7 +51,10 @@ goto :eof
 setlocal EnableDelayedExpansion
 set command=%~1
 set args=%2
-if "!command!"=="search" (
+
+if "!command!"=="cat" (
+    call :zoop_cat !args!
+) else if "!command!"=="search" (
     call :zoop_search !args!
 ) else if "!command!"=="list" (
     rem Count the backslashes in %SCOOP%