Exemplo n.º 1
0
        public void Parse_ValidArgs_ReturnsTrue()
        {
            var args = new[] { "-port", "500", "-url", "http://hello/" };

            var result = _parser.Parse(args);

            Assert.IsTrue(result.Success);
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 private void ParseProgram(string programText)
 {
     commands = CommandsParser.Parse(programText);
 }