Open
Description
v2.0.0-beta5.25306.1
I have some default values that can be sourced from environment variables if they're present.
For example,
var passwordOption = new Option<string?>("--password". "-p", "/p")
{
Description = "The password to use.",
DefaultValueFactory = defaultValue =>
{
if (string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("_Password")))
{
return null;
}
return Environment.GetEnvironmentVariable("_Password");
}
};
Currently the help text would display
-p, --password The password to use. []
It would, to my mind, be cleaner if, when the DefaultValueFactory
returns null that nothing is displayed as the default, because in this case there is no default.
e.g.
-p, --password The password to use.