commandlineparser / commandlineparser/commandline
Enum with 0 value not shown on Example
- 主要語言
- C#
- 星號
- 4.8k
- 分支
- 478
- 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 Examples
{
get
{
foreach (EntityType entityType in Enum.GetValues(typeof(EntityType)))
{
yield return new Example(entityType.ToString(), new MyOption { MyEntityType = entityType});
}
}
}
}
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
從回報中的重現開始,先查看 Examples 屬性及其 Enum.GetValues 迭代,然後追蹤每個傳回的 Example 如何被呈現。重現以 X0 作為列舉預設值的情況,並將其與 X0 = 1 進行比較。當為 X0 產生的範例能與 X1 和 X2 一致地填入並顯示時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp
- 領域
- cli
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100