commandlineparser / commandlineparser/commandline
Treat .NET 7 `required` properties as actually required by default
- 主要語言
- C#
- 星號
- 4.8k
- 分支
- 478
- PR 合併指標
- 30 天內沒有已合併 PR
描述
**Code snippet:**
```cs
public class Options
{
[Option]
public required int Port { get; init; }
[Option]
public required string Server { get; init; }
}
```
**Expected behaviour:** Both `Port` and `Server` are required and the parsing fails if at least on of them is not present.
**Actual behaviour:** They are not required, I still have to specify `[Option(Required = true)]` in order for it to work
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
Start by tracing how [Option] properties are inspected and how their Required setting is inferred, paying attention to the .NET 7 required properties shown in the issue. Add regression coverage for missing Port and Server values, and verify that parsing fails without an explicit Required setting while existing option behavior remains unchanged.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp
- 領域
- cli
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100