From 0992ed87631d96f5031cb599afbf52fd2714ec2b Mon Sep 17 00:00:00 2001 From: eggbean <815311+eggbean@users.noreply.github.com> Date: Fri, 12 Jan 2024 18:08:34 +0000 Subject: [PATCH] Add instructions for cmd.exe wrapper to README.md --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cad679b..76bb9eb 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Fast `scoop search` drop-in replacement 🚀 scoop install scoop-search ``` -## Hook +## PowerShell hook Instead of using `scoop-search.exe ` you can setup a hook that will run `scoop-search.exe` whenever you use native `scoop search` @@ -21,6 +21,28 @@ Add this to your Powershell profile (usually located at `$PROFILE`) Invoke-Expression (&scoop-search --hook) ``` +## CMD.exe wrapper + +If you use `cmd.exe` you can use a wrapper script to do the same. Name this `scoop.cmd` and add it to +a directory in your `%PATH%` + +``` +@echo off + +if "%1" == "search" ( + call :search_subroutine %* +) else ( + powershell scoop.ps1 %* +) +goto :eof + +:search_subroutine +set "args=%*" +set "newargs=%args:* =%" +scoop-search.exe %newargs% +goto :eof +``` + ## Features Behaves just like `scoop search` and returns identical output. If any differences are found please open an issue.