commandlineparser / commandlineparser/commandline

Support for arguments that require each other but are optional

オープン
#383 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
C#
スター
4.8k
フォーク
478
PR マージ指標
30日以内にマージされた PR はありません

説明

Similar to the MutuallyExclusiveSet, it would be very helpful to be able to specify that if argument A is specified then argument B is required, but if A is not specified, then B is optional.

This may be a very specific use case, and I wouldn't even pursue it, but I'm having difficulty using the built in HelpWriter when my additional validation fails, since this validation is outside of the normal flow.

An alternative would be to support passing a Function to something like parser.CustomValidation() where the developer could get the parsed options (that were properly parsed) and run additional validation checks. If a check fails the developer can raise an exception.

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

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

調査の方向性

まず既存の MutuallyExclusiveSet と HelpWriter の実装を見つけ、次に解析されたオプションと検証失敗がパーサーを通じてどのように処理されるかを確認します。要求されている依存するオプション引数と、提案されている CustomValidation 関数を比較します。合意した1つの動作が実装され、そのヘルプ/エラー処理がテストでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp
領域
cli
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

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

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