commandlineparser / commandlineparser/commandline
Can I add validate feature in Set parameter, and throw exception, and show usage?
オープン
- 主要言語
- C#
- スター
- 4.8k
- フォーク
- 478
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Can I add validate feature in Set parameter, and throw exception, and show usage?
is there exception handling in command line parameter parsing?
[Option(
'f', "filename",
HelpDesk = "Specifies the input file")]
public string Name
{
get { return mName; }
set
{
Regex regex = new Regex("^[0-9a-z]+.txt$");
if (regex.Match(value).Success )
throw new InvalidOptionValueException(
"The name must be txt file", false);
mName = value;
}
}
Private string mName;
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。