public static string[] GetMultiple(string[] commandLineArgs, string key) { if (commandLineArgs.Contains(key)) { var index = commandLineArgs.ToList().IndexOf(key); return(commandLineArgs.Skip(index + 1).TakeWhile(k => !ArgumentKey.IsKey(k)).ToArray()); } return(null); }
public static string GetSingle(string[] commandLineArgs, string key) { if (commandLineArgs.Contains(key)) { var index = commandLineArgs.ToList().IndexOf(key); var parts = commandLineArgs.Skip(index + 1).TakeWhile(k => !ArgumentKey.IsKey(k)).ToArray(); return(string.Join(" ", parts)); } return(null); }