private static bool TryParseParameterizedArgument(string argument, out CommandArgument commandArgument) { var match = Regex.Match(argument, @"--(?<argumentName>[^\ \=]*)[\ \n]?$"); if (match.Success) { commandArgument = new CommandArgument(match.Groups["argumentName"].Value, null); } else { commandArgument = null; } return commandArgument != null; }
private static bool TryParseNoValueArgument(string argument, out CommandArgument commandArgument) { var match = Regex.Match(argument, @"--(?<argumentName>[^\ ]*)=(?<argumentValue>[^\ ]*)"); if (match.Success) { commandArgument = new CommandArgument(match.Groups["argumentName"].Value, match.Groups["argumentValue"].Value); } else { commandArgument = null; } return commandArgument != null; }