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 还没有评估数据。