diff --git a/README.md b/README.md index 53f503d2..c9531e0c 100644 --- a/README.md +++ b/README.md @@ -128,14 +128,14 @@ MISCELLANEOUS: -paths string File or comma separated paths to request (deprecated) OUTPUT: - -o, -output string File to write output - -sr, -store-response Store HTTP responses - -srd, -store-response-dir string Custom directory to store HTTP responses (default "output") - -json Output in JSONL(ines) format - -irr, -include-response Include HTTP request/response in JSON output (-json only) - -include-chain Include redirect HTTP Chain in JSON output (-json only) - -store-chain Include HTTP redirect chain in responses (-sr only) - -csv Output in CSV format + -o, -output string file to write output + -sr, -store-response store http response to output directory + -srd, -store-response-dir string store http response to custom directory (default "output") + -csv store output in CSV format + -json store output in JSONL(ines) format + -irr, -include-response include http request/response in JSON output (-json only) + -include-chain include redirect http chain in JSON output (-json only) + -store-chain include http redirect chain in responses (-sr only) CONFIGURATIONS: -r, -resolvers string[] List of custom resolvers (file or comma separated) diff --git a/runner/options.go b/runner/options.go index 550f240b..68c10686 100644 --- a/runner/options.go +++ b/runner/options.go @@ -263,14 +263,14 @@ func ParseOptions() *Options { ) createGroup(flagSet, "output", "Output", - flagSet.StringVarP(&options.Output, "output", "o", "", "File to write output"), - flagSet.BoolVarP(&options.StoreResponse, "store-response", "sr", false, "Store HTTP responses"), - flagSet.StringVarP(&options.StoreResponseDir, "store-response-dir", "srd", "output", "Custom directory to store HTTP responses"), - flagSet.BoolVar(&options.JSONOutput, "json", false, "Output in JSONL(ines) format"), - flagSet.BoolVarP(&options.responseInStdout, "include-response", "irr", false, "Include HTTP request/response in JSON output (-json only)"), - flagSet.BoolVar(&options.chainInStdout, "include-chain", false, "Include redirect HTTP Chain in JSON output (-json only)"), - flagSet.BoolVar(&options.StoreChain, "store-chain", false, "Include HTTP redirect chain in responses (-sr only)"), - flagSet.BoolVar(&options.CSVOutput, "csv", false, "Output in CSV format"), + flagSet.StringVarP(&options.Output, "output", "o", "", "file to write output results"), + flagSet.BoolVarP(&options.StoreResponse, "store-response", "sr", false, "store http response to output directory"), + flagSet.StringVarP(&options.StoreResponseDir, "store-response-dir", "srd", "output", "store http response to custom directory"), + flagSet.BoolVar(&options.CSVOutput, "csv", false, "store output in CSV format"), + flagSet.BoolVar(&options.JSONOutput, "json", false, "store output in JSONL(ines) format"), + flagSet.BoolVarP(&options.responseInStdout, "include-response", "irr", false, "include http request/response in JSON output (-json only)"), + flagSet.BoolVar(&options.chainInStdout, "include-chain", false, "include redirect http chain in JSON output (-json only)"), + flagSet.BoolVar(&options.StoreChain, "store-chain", false, "include http redirect chain in responses (-sr only)"), ) createGroup(flagSet, "configs", "Configurations", @@ -391,7 +391,11 @@ func (options *Options) validateOptions() { options.Resolvers = resolvers if len(options.Resolvers) > 0 { gologger.Debug().Msgf("Using resolvers: %s\n", strings.Join(options.Resolvers, ",")) + } + if options.StoreResponseDir != "" && !options.StoreResponse { + gologger.Debug().Msgf("Store response directory specified, enabling \"sr\" flag automatically\n") + options.StoreResponse = true } }