commandlineparser/commandline

Enum with 0 value not shown on Example

开放

#379 创建于 2018年12月7日

 (3 条评论) (0 个反应) (0 位负责人)C# (461 个派生)batch import
buggood first issue

仓库指标

星标
 (4,280 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

public class MyOption { [Option('t', "type", Required = true, HelpText = "My entity")] public EntityType MyEntityType { get; set; } public enum MyEntityType { X0, // Example for X0 is empty. If change this line to X0 =1, everything is ok X1, X2 }

    [Usage(ApplicationAlias = "...")]
    public static IEnumerable<Example> Examples
    {
        get
        {
            foreach (EntityType entityType in Enum.GetValues(typeof(EntityType)))
            {
                yield return new Example(entityType.ToString(), new MyOption { MyEntityType = entityType});
            }
        }
    }
}

贡献者指南