/// <summary> /// Performs a match if this condition is met /// </summary> /// <param name="arg">command argument value</param> /// <returns></returns> public bool Match(CommandArgValue arg) { if (Matched) { return(true); } if (arg != null && Condition(arg)) { Arg = arg; return(true); } return(false); }
public static string GetValue(this CommandArgValue arg) { return((!(arg is CommandArgKeypair argKeyPair)) ? null : ((argKeyPair.ValueType == CommandArgItemType.String) ? argKeyPair.Value.UnwrapQuotes() : argKeyPair.Value)); }
public static string GetKey(this CommandArgValue arg) { return((arg == null) ? null : ((arg.Type == CommandArgItemType.String) ? arg.Key.UnwrapQuotes() : arg.Key)); }