commandlineparser / commandlineparser/commandline

Support for arguments that require each other but are optional

Open
#383 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.8k
Forks
478
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.