Closed ron-myers closed 4 years ago
Hi, thanks for PR!
I guess the name of test Environment_variables_pulled_ignoring_case
is wrong, it should say "while_respecting_case", right?
Please also add a comment about case sensitivity on different OSes to CliApplication.RunAsync
where the environment variables are extracted. It would be useful to know in the future why this decision was made.
Also, this part will need to be updated as well:
Thanks!
Summary
This corrects the bug identified in #64.
Approach
The solution to this was less obvious than I expected when I sat down to build this.
As I saw it, there were a few options here:
I then read:
https://docs.microsoft.com/en-us/dotnet/api/system.environment.getenvironmentvariable
which includes:
Then attempted to set two environment variables on Windows that only differed by case and did not find a way to do so.
So decided to approach with Ordinal string comparison and submit for discussion.
Going with this approach required a change in
CommandOptionsSchema
Added a unit test to verify the behaviour.
Happy to iterate if you have a preferred approach.
Fixes #64