PowerArgs.CommandLineArgumentsDefinition.CreateVariableResolver C# (CSharp) Method

CreateVariableResolver() public method

Gives you an object that you can use to tell if a particular argument was specified on the command line.
public CreateVariableResolver ( ) : IBooleanVariableResolver
return IBooleanVariableResolver
        public IBooleanVariableResolver CreateVariableResolver()
        {
            return new FuncBooleanVariableResolver((variableIdentifier) =>
            {
                foreach (var argument in this.Arguments)
                {
                    if (argument.IsMatch(variableIdentifier))
                    {
                        return argument.RevivedValue != null;
                    }
                }

                if (this.SpecifiedAction != null)
                {
                    foreach (var argument in this.SpecifiedAction.Arguments)
                    {

                        if (argument.IsMatch(variableIdentifier))
                        {
                            return argument.RevivedValue != null;
                        }
                    }
                }

                throw new InvalidArgDefinitionException(string.Format("'{0}' is not a valid argument alias", variableIdentifier));
            });
        }