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:
parent
ceeb47eeb1
commit
31636a6ae8
|
@ -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 {
|
||||
|
|
|
@ -232,6 +232,7 @@ func ParseGlobalOptions(c *cli.Context) (libgobuster.Options, error) {
|
|||
}
|
||||
|
||||
if c.Bool("no-color") {
|
||||
opts.NoColor = true
|
||||
color.NoColor = true
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ type Options struct {
|
|||
NoStatus bool
|
||||
NoProgress bool
|
||||
NoError bool
|
||||
NoColor bool
|
||||
Quiet bool
|
||||
Delay time.Duration
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue