: nply/zoop

commit c5190798195f1c510cf313d9b572bc2e5f809b7f
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Fri, 27 Mar 2026 20:07:29 +0530

Initial Commit
4 files changed, 85 insertions(+), 0 deletions(-)
A
.gitattributes
|
1
+
A
LICENSE
|
7
+++++++
A
README
|
13
+++++++++++++
A
zoop.cmd
|
64
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/.gitattributes b/.gitattributes
@@ -0,0 +1 @@
+*.cmd text=auto eol=erlf
diff --git a/LICENSE b/LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2026 Bharatvaj Hemanth <bharatvaj@yahoo.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README b/README
@@ -0,0 +1,13 @@
+zoop
+====
+
+zoop is a dead simple replacement for the popular package downloader scoop
+written in batch for maximum portability.
+
+It is an attempt to create a powershell free, bootstrappable downloader, and
+be very fast at it, at the cost of some features.
+
+Currently the following operations of scoop are supported,
+
+* list
+* search
diff --git a/zoop.cmd b/zoop.cmd
@@ -0,0 +1,64 @@
+@echo off
+goto :main
+
+:print_usage
+echo Usage: zoop ^<command^> [^<pkg^>]
+echo Available commands are listed below.
+echo.
+echo    search     Search available apps
+echo    list       List installed apps
+goto :eof
+
+:zoop_search
+setlocal EnableDelayedExpansion
+for /f "usebackq" %%i in (`dir /B /A:D "%SCOOP%\buckets\*" 2^>nul`) do (
+    for /f "usebackq" %%j in (`dir /B /A:-D "%SCOOP%\buckets\%%i\bucket\*%~1*.json" 2^>nul`) do (
+        echo %%~nj
+    )
+)
+endlocal DisableDelayedExpansion
+goto :eof
+
+:zoop_list
+setlocal EnableDelayedExpansion
+rem for /f "usebackq" %%i in (`dir /B /A:D "%SCOOP%\apps\*" 2^>nul`) do (
+for /d %%i in ("%SCOOP%\apps\*") do (
+    rem for /f "usebackq skip=5 tokens=5 delims=[] " %%j in (`dir /A:L "%%i" 2^>nul ^| findstr.exe "^<JUNCTION^>" 2^>nul`) do (
+    rem for /f "usebackq skip=5 tokens=5 delims=[] " %%j in (`dir /A:L "%%i" 2^>nul ^| findstr.exe /v " bytes" 2^>nul`) do (
+    for /f "usebackq skip=5 tokens=%1,%2 delims=\[] " %%j in (`dir /A:L "%%i\curren*" 2^>nul`) do (
+        echo %%j/%%k
+    rem     rem set "jnk_path=%%j"
+    rem     rem echo !jnk_path:\??\%SCOOP%\apps\=!
+    )
+)
+endlocal DisableDelayedExpansion
+goto :eof
+
+:main
+setlocal EnableDelayedExpansion
+set command=%~1
+set args=%2
+if "!command!"=="search" (
+    call :zoop_search !args!
+) else if "!command!"=="list" (
+    rem Count the backslashes in %SCOOP%
+    set /a "backslashes=-1"
+    for %%i in (%SCOOP:\= %) do set /a backslashes+=1
+    REM Token in zoop_list is '\[] '
+    REM 06-Mar-26  01:10    <JUNCTION>     current [\??\C:\ProgramData\scoop\apps\vim\9.2.0]
+    REM ^1         ^2       ^3             ^4     ^5^6^7^8
+    set /a "app_index=8+!backslashes!"
+    set /a "version_index=!app_index!+1"
+    echo Count %SCOOP% !backslashes! !app_index! !version_index!
+    call :zoop_list !app_index! !version_index!
+) else if "!command!"=="help" (
+    call :print_usage
+    exit /b 0
+) else (
+    call :print_usage
+    exit /b 1
+)
+endlocal DisableDelayedExpansion
+goto :eof
+
+call :zoop_search %*