diff --git a/README.md b/README.md index d6c91e3..2507cc4 100644 --- a/README.md +++ b/README.md @@ -242,23 +242,16 @@ import ( ) func main() { - config := runner.ConfigFile{ - // Use the default list of resolvers by marshaling it to the config - Resolvers: resolve.DefaultResolvers, - // Use the default list of passive sources - Sources: passive.DefaultSources, - // Use the default list of all passive sources - AllSources: passive.DefaultAllSources, - // Use the default list of recursive sources - Recursive: passive.DefaultRecursiveSources, - } - runnerInstance, err := runner.NewRunner(&runner.Options{ Threads: 10, // Thread controls the number of threads to use for active enumerations Timeout: 30, // Timeout is the seconds to wait for sources to respond MaxEnumerationTime: 10, // MaxEnumerationTime is the maximum amount of time in mins to wait for enumeration - YAMLConfig: config, - }) + Resolvers: resolve.DefaultResolvers, // Use the default list of resolvers by marshaling it to the config + Sources: passive.DefaultSources, // Use the default list of passive sources + AllSources: passive.DefaultAllSources, // Use the default list of all passive sources + Recursive: passive.DefaultRecursiveSources, // Use the default list of recursive sources + Providers: &runner.Providers{}, // Use empty api keys for all providers + }) buf := bytes.Buffer{} err = runnerInstance.EnumerateSingleDomain(context.Background(), "projectdiscovery.io", []io.Writer{&buf}) diff --git a/v2/pkg/runner/options.go b/v2/pkg/runner/options.go index 8d22d17..2ed3cac 100644 --- a/v2/pkg/runner/options.go +++ b/v2/pkg/runner/options.go @@ -66,8 +66,6 @@ type Options struct { // ParseOptions parses the command line flags provided by a user func ParseOptions() *Options { - showBanner() - // Migrate config to provider config if fileutil.FileExists(defaultConfigLocation) && !fileutil.FileExists(defaultProviderConfigLocation) { gologger.Info().Msgf("Detected old %s config file, trying to migrate providers to %s\n", defaultConfigLocation, defaultProviderConfigLocation) @@ -81,6 +79,7 @@ func ParseOptions() *Options { } options := &Options{} + var err error flagSet := goflags.NewFlagSet() flagSet.SetDescription(`Subfinder is a subdomain discovery tool that discovers subdomains for websites by using passive online sources.`) @@ -174,6 +173,10 @@ func ParseOptions() *Options { options.preProcessOptions() + if !options.Silent { + showBanner() + } + // Validate the options passed by the user and if any // invalid options have been used, exit. err = options.validateOptions()