public void Parse_ValidArgs_ReturnsTrue() { var args = new[] { "-port", "500", "-url", "http://hello/" }; var result = _parser.Parse(args); Assert.IsTrue(result.Success); }
private static void ParseArgs(string[] args) { var parser = new CommandsParser <CommandLineOptions>(); var result = parser.Parse(args); if (!result.Success) { foreach (var error in result.Errors) { Logger.Error(error); } Exit(-1); } CommandLineOptions.Global = result.Options; }
private void ParseProgram(string programText) { commands = CommandsParser.Parse(programText); }