Skip to content

Commit

Permalink
add option no-stdin (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciyfly authored Jun 11, 2023
1 parent d6dbd18 commit 5984aad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type ScanOptions struct {
Hashes string
Screenshot bool
UseInstalledChrome bool
DisableStdini bool
}

func (s *ScanOptions) Clone() *ScanOptions {
Expand Down Expand Up @@ -268,6 +269,7 @@ type Options struct {
NoDecode bool
Screenshot bool
UseInstalledChrome bool
DisableStdin bool
}

// ParseOptions parses the command line options for application
Expand Down Expand Up @@ -400,6 +402,7 @@ func ParseOptions() *Options {
flagSet.BoolVarP(&options.LeaveDefaultPorts, "leave-default-ports", "ldp", false, "leave default http/https ports in host header (eg. http://host:80 - https://host:443"),
flagSet.BoolVar(&options.ZTLS, "ztls", false, "use ztls library with autofallback to standard one for tls13"),
flagSet.BoolVar(&options.NoDecode, "no-decode", false, "avoid decoding body"),
flagSet.BoolVar(&options.DisableStdin, "no-stdin", false, "Disable Stdin processing"),
)

flagSet.CreateGroup("debug", "Debug",
Expand Down
2 changes: 1 addition & 1 deletion runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (r *Runner) prepareInput() {
numHosts += numTargetsFile
}
}
if fileutil.HasStdin() {
if !r.options.DisableStdin && fileutil.HasStdin() {
numTargetsStdin, err := r.loadAndCloseFile(os.Stdin)
if err != nil {
gologger.Fatal().Msgf("Could not read input from stdin: %s\n", err)
Expand Down

0 comments on commit 5984aad

Please sign in to comment.