dotnet / command-line-api

Command line parsing, invocation, and rendering of terminal output.
https://github.com/dotnet/command-line-api/wiki
MIT License
3.35k stars 375 forks source link

EnvironmentDirective has a hard-coded call to Environment.SetEnvironmentVariable making it hard to test #2363

Open tmat opened 3 months ago

tmat commented 3 months ago

It would be better if it accepted an Action that would be invoked to set the variable as an optional parameter to the constructor.

new EnvironmentVariablesDirective((name, value) => ...);