Automatically display default values of options in the help page (#1032)

Fixes #973
This commit is contained in:
Cédric Luthi
2022-12-28 21:28:41 +01:00
committed by GitHub
parent 4a8a4ab048
commit 3e6e0990c5
12 changed files with 154 additions and 62 deletions

View File

@@ -4,6 +4,7 @@ internal sealed class CommandAppSettings : ICommandAppSettings
{
public string? ApplicationName { get; set; }
public string? ApplicationVersion { get; set; }
public bool ShowOptionDefaultValues { get; set; }
public IAnsiConsole? Console { get; set; }
public ICommandInterceptor? Interceptor { get; set; }
public ITypeRegistrarFrontend Registrar { get; set; }
@@ -22,6 +23,7 @@ internal sealed class CommandAppSettings : ICommandAppSettings
{
Registrar = new TypeRegistrar(registrar);
CaseSensitivity = CaseSensitivity.All;
ShowOptionDefaultValues = true;
}
public bool IsTrue(Func<CommandAppSettings, bool> func, string environmentVariableName)