コード例 #1
0
 /// <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);
 }
コード例 #2
0
 /// <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>()));
 }
コード例 #3
0
 /// <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));
 }
コード例 #4
0
 // 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);
 }