1
1
Fork 0
mirror of https://github.com/OJ/gobuster.git synced 2024-05-13 12:56:03 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
firefart c99e164923 also respect quiet mode 2024-02-02 18:45:22 +01:00
firefart 591136d4da taskfile 2024-02-02 13:28:50 +01:00
2 changed files with 14 additions and 14 deletions

View File

@ -10,11 +10,11 @@ tasks:
- go mod tidy -v
build:
aliases: [default, linux]
aliases: [default]
cmds:
- go fmt ./...
- go vet ./...
- go build -o {{.PROGRAM}}
- go build -o {{.OUTPUT_FILE | default .PROGRAM}}
env:
CGO_ENABLED: 0
@ -29,6 +29,8 @@ tasks:
windows:
cmds:
- task: build
vars:
OUTPUT_FILE: "{{.PROGRAM}}.exe"
env:
CGO_ENABLED: 0
GOOS: windows

View File

@ -36,7 +36,7 @@ func resultWorker(g *libgobuster.Gobuster, filename string, wg *sync.WaitGroup)
}
if s != "" {
s = strings.TrimSpace(s)
if g.Opts.NoProgress {
if g.Opts.NoProgress || g.Opts.Quiet {
_, _ = fmt.Printf("%s\n", s)
} else {
// only print the clear line when progress output is enabled
@ -89,17 +89,15 @@ func messageWorker(g *libgobuster.Gobuster, wg *sync.WaitGroup) {
}
func printProgress(g *libgobuster.Gobuster) {
if !g.Opts.Quiet && !g.Opts.NoProgress {
requestsIssued := g.Progress.RequestsIssued()
requestsExpected := g.Progress.RequestsExpected()
if g.Opts.Wordlist == "-" {
s := fmt.Sprintf("%sProgress: %d", TERMINAL_CLEAR_LINE, requestsIssued)
_, _ = fmt.Fprint(os.Stderr, s)
// only print status if we already read in the wordlist
} else if requestsExpected > 0 {
s := fmt.Sprintf("%sProgress: %d / %d (%3.2f%%)", TERMINAL_CLEAR_LINE, requestsIssued, requestsExpected, float32(requestsIssued)*100.0/float32(requestsExpected))
_, _ = fmt.Fprint(os.Stderr, s)
}
requestsIssued := g.Progress.RequestsIssued()
requestsExpected := g.Progress.RequestsExpected()
if g.Opts.Wordlist == "-" {
s := fmt.Sprintf("%sProgress: %d", TERMINAL_CLEAR_LINE, requestsIssued)
_, _ = fmt.Fprint(os.Stderr, s)
// only print status if we already read in the wordlist
} else if requestsExpected > 0 {
s := fmt.Sprintf("%sProgress: %d / %d (%3.2f%%)", TERMINAL_CLEAR_LINE, requestsIssued, requestsExpected, float32(requestsIssued)*100.0/float32(requestsExpected))
_, _ = fmt.Fprint(os.Stderr, s)
}
}