public FindMatchingArgument ( string key, bool throwIfMoreThanOneMatch = false ) : CommandLineArgument | ||
key | string | The key as if it was typed in on the command line. This can also be an alias. |
throwIfMoreThanOneMatch | bool | If set to true then this method will throw and InvalidArgDeginitionException if more than 1 match is found |
return | CommandLineArgument |
public CommandLineArgument FindMatchingArgument(string key, bool throwIfMoreThanOneMatch = false)
{
return CommandLineArgumentsDefinition.FindMatchingArgument(key, throwIfMoreThanOneMatch, this.Arguments);
}
CommandLineArgumentsDefinition::FindMatchingArgument ( string key, bool throwIfMoreThanOneMatch, IEnumerable |
private static bool IsBool(string key, CommandLineArgumentsDefinition definition, ParseResult resultContext) { var match = definition.FindMatchingArgument(key, true); if (match == null) { var possibleActionContext = resultContext.ImplicitParameters.ContainsKey(0) ? resultContext.ImplicitParameters[0] : null; if (possibleActionContext == null) { return(false); } else { var actionContext = definition.FindMatchingAction(possibleActionContext, true); if (actionContext == null) { return(false); } match = actionContext.FindMatchingArgument(key, true); if (match == null) { return(false); } } } return(match.ArgumentType == typeof(bool)); }