Exemple #1
0
        static async Task REPL()
        {
            CLIFactory      factory         = new CLIFactory();
            CommandExecutor commandExecutor = new CommandExecutor(factory);

            while (true)
            {
                Console.Write(">> ");
                string line = Console.ReadLine();

                if (line.Trim().Equals("exit"))
                {
                    Console.WriteLine("See you.");
                    break;
                }

                string[] input = line.Split();
                await commandExecutor.RunAsync(input);
            }
        }
Exemple #2
0
 public CommandExecutor(CLIFactory Factory)
 {
     this.parser = Factory.MakeParser();
     this.router = Factory.MakeRouter();
 }