예제 #1
0
        static int Main(string[] args)
        {
            // Setup the console output stream.
            StreamWriter output = new StreamWriter(Console.OpenStandardOutput())
            {
                AutoFlush = true
            };

            Console.SetOut(output);

            // Parse the sectorfile
            CompilerArguments compilerArguments = CompilerArgumentsFactory.Make();
            CliArguments      cliArguments      = CliArgumentsFactory.Make();

            try
            {
                ArgumentParserFactory.Make().CreateFromCommandLine(compilerArguments, cliArguments, args);
            } catch (ArgumentException exception)
            {
                output.Write(exception.Message);
                return(1);
            }

            int returnCode = SectorFileCompilerFactory.Create(
                compilerArguments,
                new List <IEventObserver>()
            {
                new ConsoleOutput(output)
            }
                ).Compile();

            if (cliArguments.PauseOnFinish)
            {
                output.Write("Press any key to exit");
                Console.ReadKey();
            }
            return(returnCode);
        }
예제 #2
0
 public void TestItAddsCliArguments(Type type)
 {
     Assert.True(ArgumentParserFactory.Make().HasCliArgument(type));
 }
예제 #3
0
 public ArgumentParserTest()
 {
     parser            = ArgumentParserFactory.Make();
     compilerArguments = CompilerArgumentsFactory.Make();
     cliArguments      = CliArgumentsFactory.Make();
 }