commandlineparser/commandline

Enum with 0 value not shown on Example

オープン

#379 opened on 2018/12/07

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)C# (461 件のフォーク)batch import
buggood first issue

Repository metrics

Stars
 (4,280 個のスター)
PR merge metrics
 (30d に merged 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});
            }
        }
    }
}

コントリビューターガイド