toolbelt icon indicating copy to clipboard operation
toolbelt copied to clipboard

Use oclif env default for relevant flags

Open ridem opened this issue 6 years ago • 2 comments

This would basically mean replacing:

SomeCommand.flags = {
  projectId: flags.string({
    char: 'p',
    description: 'Forest project ID',
    required: true,
  })
};

with

SomeCommand.flags = {
  projectId: flags.string({
    char: 'p',
    description: 'Forest project ID',
    required: true,
    env: 'FOREST_PROJECT_ID'
  })
};

Usually, in the scope of one code project where the toolbelt is used, there's also only one Forest project that is tied to it

ridem avatar Apr 17 '19 15:04 ridem

Hi @ridem, Thanks for the suggestion.

It would mean that you'll have to manually define the FOREST_PROJECT_ID in your repositories, right?

arnaudbesnier avatar Apr 18 '19 12:04 arnaudbesnier

It would mean that I can use an ENV variable instead of the flag yes, and that the forest project ID is known and part of my environment for this project.

Not urgent at all, just something that could be helpful in the future as the toolbelt grows and might be used in a CI context

ridem avatar Apr 19 '19 10:04 ridem