jmcdo29/nest-commander

@Option env support

rovrevik opened this issue · 1 comments

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Our build system is driven largely by environment variables and we end up writing extra code in our commands to set options with values pulled from the environment and checking that an option value had not been provided after the fact.

Describe the solution you'd like

Support env property in @option to specify the environment variable name to set an option with when not supplied directly on the command line.

Ideally, this would expose current support in https://github.com/tj/commander.js/blob/master/examples/options-env.js

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

We would like to support setting options via the environment if not provide directly as an argument.

Looks like this would simply be hooking up another pre-existing option from commander, right? Should be easy enough to get going. I'll see how soon I can get this in and tested