/// <summary> /// Parse command line arguments. /// </summary> /// <param name="def">The command line definition</param> /// <param name="args">The arguments passed to the application</param> /// <exception cref="CommandLineArgsException">Thrown if there is an error in the arguments passed into the application</exception> /// <exception cref="ArgumentException">Thrown if there is an error in the <see cref="SwitchesDefBase"/> instance</exception> public static void Parse(SwitchesDefBase def, params string[] args) { SwitchesParser parser = new SwitchesParser(def); int nextArg = parser.Parse(args); // copy any extra arguments if (nextArg < args.Length) { string[] extraArgs = new string[args.Length - nextArg]; Array.Copy(args, nextArg, extraArgs, 0, args.Length - nextArg); def.SetExtraArguments(extraArgs); } }
public SwitchCollection(SwitchesDefBase def) { m_def = def; }
/// <summary> /// Ctor is private because users should use the static Parse method. /// </summary> /// <param name="def"></param> private SwitchesParser(SwitchesDefBase def) { m_def = def; }