/// <summary> /// Parse command line options and returns an ILGarbageCollector object on sucess. /// On error, this method prints help information and returns null /// </summary> /// <param name="args">The array of command line arguments</param> /// <returns>On success: a populated ILGarbageCollector. On failure: null.</returns> private static ILGarbageCollectorOptions ParseOptions(string[] args) { var options = new ILGarbageCollectorOptions(); options.Parse(args); if (options.HelpRequested) { options.PrintOptions(""); return null; } if (options.HasErrors) { options.PrintErrorsAndExit(Console.Out); return null; } return options; }
/// <summary> /// Parse command line options and returns an ILGarbageCollector object on sucess. /// On error, this method prints help information and returns null /// </summary> /// <param name="args">The array of command line arguments</param> /// <returns>On success: a populated ILGarbageCollector. On failure: null.</returns> private static ILGarbageCollectorOptions ParseOptions(string[] args) { var options = new ILGarbageCollectorOptions(); options.Parse(args); if (options.HelpRequested) { options.PrintOptions(""); return(null); } if (options.HasErrors) { options.PrintErrorsAndExit(Console.Out); return(null); } return(options); }