Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckMandatoryArguments not being evaluated #63

Closed
tekgator opened this issue Jan 23, 2019 · 1 comment
Closed

CheckMandatoryArguments not being evaluated #63

tekgator opened this issue Jan 23, 2019 · 1 comment

Comments

@tekgator
Copy link

CheckMandatoryArguments is set to false and a mandatory parameter is not passed will still throw an Exception. Looking at the code the CheckMandatoryArguments doesn't seem to be evaluated.

/// <summary>
/// Checks whether or non-optional arguments were defined on the command line. 
/// </summary>
/// <exception cref="MandatoryArgumentNotSetException"><see cref="Argument.Optional">Non-optional</see> argument not defined.</exception>
/// <seealso cref="CheckMandatoryArguments"/>, <seealso cref="Argument.Optional"/>
private void PerformMandatoryArgumentsCheck()
{
    _arguments.ForEach(delegate (Argument arg)
    {
        if (!arg.Optional && !arg.Parsed)
            throw new MandatoryArgumentNotSetException(string.Format(Messages.EXC_MISSING_MANDATORY_ARGUMENT, arg.Name), arg.Name);
    });
}
StefH added a commit that referenced this issue Jun 2, 2019
@StefH
Copy link
Collaborator

StefH commented Jun 2, 2019

Solved in next version.

@StefH StefH closed this as completed Jun 2, 2019
@StefH StefH mentioned this issue Jun 2, 2019
StefH added a commit that referenced this issue Jun 2, 2019
* Strong -> Forced

* #64

* #63

* .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants