From 709c4fc6aa10d137f40b7aa09f3f8d2c1008989f Mon Sep 17 00:00:00 2001 From: edoardottt Date: Mon, 7 Apr 2025 14:42:56 +0200 Subject: [PATCH] improve make.bat --- README.md | 4 ++-- make.bat | 29 +++++++++++++++++++---------- pkg/input/flags.go | 2 +- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 41aac17..4bce397 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Usage of cariddi: -json Print the output as JSON in stdout. -md - Maximum level the crawler will follow from the initial target URL. + Maximum depth level the crawler will follow from the initial target URL. -i string Ignore the URL containing at least one of the elements of this array. -info @@ -178,7 +178,7 @@ Examples 💡 - `cat urls | cariddi -ua "Custom User Agent"` (Use a custom User Agent) - `cat urls | cariddi -json` (Print the output as JSON in stdout) - `cat urls | cariddi -sr` (Store HTTP responses) -- `cat urls | cariddi -md 3` (Max 3 levels) +- `cat urls | cariddi -md 3` (Max 3 depth levels) - For Windows: - use `powershell.exe -Command "cat urls | .\cariddi.exe"` inside the Command prompt diff --git a/make.bat b/make.bat index 2c4bc27..f6392c0 100644 --- a/make.bat +++ b/make.bat @@ -2,32 +2,32 @@ SET ARG=%1 -IF "%ARG%"=="windows" ( +IF /I "%ARG%"=="windows" ( CALL :Windows GOTO Done ) -IF "%ARG%"=="unwindows" ( +IF /I "%ARG%"=="unwindows" ( CALL :Unwindows GOTO Done ) -IF "%ARG%"=="update" ( +IF /I "%ARG%"=="update" ( CALL :Update GOTO Done ) -IF "%ARG%"=="tidy" ( +IF /I "%ARG%"=="tidy" ( CALL :Tidy GOTO Done ) -IF "%ARG%"=="lint" ( +IF /I "%ARG%"=="lint" ( CALL :Lint GOTO Done ) -IF "%ARG%"=="remod" ( +IF /I "%ARG%"=="remod" ( del go.mod del go.sum go mod init github.com/edoardottt/cariddi @@ -35,23 +35,28 @@ IF "%ARG%"=="remod" ( GOTO Done ) -IF "%ARG%"=="test" ( +IF /I "%ARG%"=="test" ( CALL :Test GOTO Done ) +IF /I "%ARG%"=="help" ( + CALL :Help + GOTO Done +) + GOTO Done :Test set GO111MODULE=on set CGO_ENABLED=0 echo Testing ... -go test -v ./... +go test -v "./..." echo Done EXIT /B 0 :Tidy -go get -u ./... +go get -u "./..." go mod tidy -v echo Done. EXIT /B 0 @@ -63,7 +68,7 @@ EXIT /B 0 :Update set GO111MODULE=on echo Updating ... -go get -u ./... +go get -u "./..." go mod tidy -v CALL :Unwindows git pull @@ -85,4 +90,8 @@ del /f cariddi.exe echo Done. EXIT /B 0 +:Help +echo Usage: make.bat [windows | unwindows | update | tidy | lint | remod | test] +EXIT /B 0 + :Done \ No newline at end of file diff --git a/pkg/input/flags.go b/pkg/input/flags.go index e20cb48..96aa273 100644 --- a/pkg/input/flags.go +++ b/pkg/input/flags.go @@ -144,7 +144,7 @@ func ScanFlag() Input { storeRespPtr := flag.Bool("sr", false, "Store HTTP responses.") - maxDepth := flag.Int("md", 0, "Maximum level the crawler will follow from the initial target URL.") + maxDepth := flag.Int("md", 0, "Maximum depth level the crawler will follow from the initial target URL.") flag.Parse()