commandlineparser / commandlineparser/commandline

Treat .NET 7 `required` properties as actually required by default

オープン
#862 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。