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});
            }
        }
    }
}

貢獻者指南