kelseyhightower / envconfig

Golang library for managing configuration data from environment variables
MIT License
5.01k stars 377 forks source link

Add support for getting a FlagSet from envconfig #167

Open ronniel1 opened 4 years ago

ronniel1 commented 4 years ago

Hi,

I would like to add the ability to create a FlagSet from envconfig. This would allow overriding the config values set in environment, using command line argument.

Using the FlagSet option would allow using envconfig in apps that already use flag or pflag for command line arguments.

I see two ways of doing this: 1 - add a GetFlagSet() method to envconfig which will use the internal gatherInfo() 2 - Expose GatherInfo() and VarInfo so that GetFlagInfo() will be implemented outside of the envconfig pkg.

What do you think?

ronniel1 commented 3 years ago

Is this something that will be considered? Should I work on a PR?