Skip to content

Pass additional parameters into Required() for conditional requirementsΒ #111

@SCLDGit

Description

@SCLDGit

It would be nice to be able to mark some additional into into the Required() field, such that a parameter is only required if some other criteria are met. An example would be only requiring a password to be input if a user name has also been used as an argument. Something like:

parser.Setup(p_arg => p_arg.UserName)
                .As('u', "user")
                .WithDescription("The user name to use for login.");

 parser.Setup(p_arg => p_arg.UserPassword)
                .As('p', "password")
                .WithDescription("The user password to use for login.")
                .Required(p_otherArgs => !string.IsNullOrWhitespace(p_otherArgs.UserName));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions