/// <summary> /// Parses the arguments and checks for named arguments and non-named arguments. /// </summary> /// <param name="args">e.g. "-config:prod.xml", "-date:T-1", "BloombergFutOpt"</param> /// <param name="prefix">Character used to identifiy the name /// of a named parameter. e.g. "-" as in "-config:prod.xml" /// Leave null or string.emtpy to indicate there is no prefix. /// In which case, only the <paramref name="separator"/> is used to distinguish /// namevalue pairs.</param> /// <param name="separator">Character used to separate the named /// argument with it's value in a named argument. e.g. ":" as in "-config:prod.xml" /// If this is null or string.empty, in addition to the <paramref name="prefix"/></param> /// <returns></returns> public static BoolMessageItem <Args> Parse(string text, string prefix, string separator, object argReciever) { return(TryCatch(() => Parse(LexArgs.ParseList(text).ToArray(), prefix, separator, argReciever))); }
/// <summary> /// Parse the line into a collection of arguments. /// </summary> /// <param name="text">"-config:prod.xml -date:T-1 BloombergFutOpt"</param> /// <returns></returns> public static BoolMessageItem <Args> Parse(string text) { return(TryCatch(() => Parse(LexArgs.ParseList(text).ToArray()))); }