diff --git a/src/Nethermind/Nethermind.Runner/Program.cs b/src/Nethermind/Nethermind.Runner/Program.cs index ffc60b4971d..f82845be458 100644 --- a/src/Nethermind/Nethermind.Runner/Program.cs +++ b/src/Nethermind/Nethermind.Runner/Program.cs @@ -242,22 +242,27 @@ void AddConfigurationOptions(CliCommand command) ConfigCategoryAttribute? typeLevel = configType.GetCustomAttribute(); - if (typeLevel is not null && (typeLevel.DisabledForCli || typeLevel.HiddenFromDocs)) + if (typeLevel is not null && typeLevel.DisabledForCli) continue; + bool categoryHidden = typeLevel?.HiddenFromDocs == true; + foreach (PropertyInfo propertyInfo in configType.GetProperties(BindingFlags.Public | BindingFlags.Instance).OrderBy(p => p.Name)) { ConfigItemAttribute? configItemAttribute = propertyInfo.GetCustomAttribute(); - if (configItemAttribute?.DisabledForCli == false || configItemAttribute?.HiddenFromDocs == false) + if (configItemAttribute?.DisabledForCli != true) { + bool hidden = categoryHidden || configItemAttribute?.HiddenFromDocs == true; + command.Add(new CliOption( $"--{ConfigExtensions.GetCategoryName(configType)}.{propertyInfo.Name}", $"--{ConfigExtensions.GetCategoryName(configType)}-{propertyInfo.Name}".ToLowerInvariant()) { Description = configItemAttribute?.Description, - HelpName = "value" + HelpName = "value", + Hidden = hidden }); }