private async Task Run()

in DTDLValidator/DTDLValidator/Interactive/Interactive.cs [23:48]


        private async Task Run()
        {
            Console.WriteLine("DTDLValidator Interactive Mode");
            bool exit = false;
            while (!exit)
            {
                Console.WriteLine();
                Console.Write("> ");
                string commandLine = Console.ReadLine();
                Task commandTask = Task.FromResult<object>(null);
                Parser.Default.ParseArguments<
                    CompareCommand,
                    ListCommand,
                    LoadCommand,
                    ShowCommand,
                    ShowInfoCommand,
                    ExitCommand>(SplitArgs(commandLine))
                    .WithParsed<CompareCommand>(command => commandTask = command.Run(this))
                    .WithParsed<ListCommand>(command => commandTask = command.Run(this))
                    .WithParsed<LoadCommand>(command => commandTask = command.Run(this))
                    .WithParsed<ShowCommand>(command => commandTask = command.Run(this))
                    .WithParsed<ShowInfoCommand>(command => commandTask = command.Run(this))
                    .WithParsed<ExitCommand>(command => exit = true);
                await commandTask;
            }
        }