mirror of
https://github.com/projectdiscovery/subfinder
synced 2026-06-21 14:05:24 +00:00
add env var support for config files
This commit is contained in:
@@ -118,6 +118,14 @@ func ParseOptions() *Options {
|
||||
flagSet.BoolVarP(&options.HostIP, "ip", "oI", false, "include host IP in output (-active only)"),
|
||||
)
|
||||
|
||||
if envConfig := os.Getenv("SUBFINDER_CONFIG"); envConfig != "" {
|
||||
defaultConfigLocation = envConfig
|
||||
}
|
||||
|
||||
if envProviderConfig := os.Getenv("SUBFINDER_PROVIDER_CONFIG"); envProviderConfig != "" {
|
||||
defaultProviderConfigLocation = envProviderConfig
|
||||
}
|
||||
|
||||
flagSet.CreateGroup("configuration", "Configuration",
|
||||
flagSet.StringVar(&options.Config, "config", defaultConfigLocation, "flag config file"),
|
||||
flagSet.StringVarP(&options.ProviderConfig, "provider-config", "pc", defaultProviderConfigLocation, "provider config file"),
|
||||
|
||||
Reference in New Issue
Block a user