/// <summary> /// Switcheses the specified args. /// </summary> /// <param name="args"> The args. </param> /// <returns> </returns> /// <remarks> /// </remarks> public static IDictionary <string, List <string> > Switches(this IEnumerable <string> args) { return(ParsedCommandLine.Parse(args).Switches); }
/// <summary> /// Gets the parameters for switch. /// </summary> /// <param name="args"> The args. </param> /// <param name="key"> The key. </param> /// <returns> </returns> /// <remarks> /// </remarks> public static IEnumerable <string> GetParametersForSwitch(this IEnumerable <string> args, string key) { return(ParsedCommandLine.Parse(args).With(p => p.Switches.ContainsKey(key) ? p.Switches[key] : Enumerable.Empty <string>())); }
/// <summary> /// Switches the value. /// </summary> /// <param name="args"> The args. </param> /// <param name="key"> The key. </param> /// <returns> </returns> /// <remarks> /// </remarks> public static string SwitchValue(this IEnumerable <string> args, string key) { return(ParsedCommandLine.Parse(args).With(p => p.Switches.ContainsKey(key) ? p.Switches[key].FirstOrDefault() : null)); }
// public static List<string> Data(this string[] args) { /// <summary> /// Parameterses the specified args. /// </summary> /// <param name="args"> The args. </param> /// <returns> </returns> /// <remarks> /// </remarks> public static IEnumerable <string> Parameters(this IEnumerable <string> args) { return(ParsedCommandLine.Parse(args).Parameters); }