commandlineparser / commandlineparser/commandline
Support for arguments that require each other but are optional
- Ngôn ngữ chính
- C#
- Star
- 4.8k
- Fork
- 478
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.