commandlineparser / commandlineparser/commandline

Support for arguments that require each other but are optional

未关闭
#383 2 条评论 2 个 reaction 已指派 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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。