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

Don't print escape sequence when no-color flag is set

This commit is contained in:
dozernz 2024-01-30 08:53:31 +13:00
parent ceeb47eeb1
commit 31636a6ae8
3 changed files with 7 additions and 1 deletions

View File

@ -36,7 +36,11 @@ func resultWorker(g *libgobuster.Gobuster, filename string, wg *sync.WaitGroup)
}
if s != "" {
s = strings.TrimSpace(s)
_, _ = fmt.Printf("%s%s\n", TERMINAL_CLEAR_LINE, s)
if(g.Opts.NoColor){
_, _ = fmt.Printf("\r%s\n", s)
} else {
_, _ = fmt.Printf("%s%s\n", TERMINAL_CLEAR_LINE, s)
}
if f != nil {
err = writeToFile(f, s)
if err != nil {

View File

@ -232,6 +232,7 @@ func ParseGlobalOptions(c *cli.Context) (libgobuster.Options, error) {
}
if c.Bool("no-color") {
opts.NoColor = true
color.NoColor = true
}

View File

@ -14,6 +14,7 @@ type Options struct {
NoStatus bool
NoProgress bool
NoError bool
NoColor bool
Quiet bool
Delay time.Duration
}