示例#1
0
        private async Task ExecuteCommand(CommandLineParameters parameters)
        {
            var command = parameters.CreateCommandExecutor(this.io);

            if (command == null)
            {
                this.PrintUnknownCommand(parameters);
            }

            bool executed = false;

            if (command != null)
            {
                executed = await command.Execute();
            }

            if (!executed)
            {
                command?.DisplayHelp();
            }
        }
示例#2
0
        private async Task ExecuteCommand(CommandLineParameters parameters)
        {
            var command = parameters.CreateCommandExecutor(this.io);

            if (command == null)
            {
                this.PrintUnknownCommand(parameters);
            }

            if (command != null)
            {
                var executed = await command.Execute();

                if (!executed)
                {
                    this.io.Writer.WriteLine();
                    command.DisplayHelp();
                }
            }

            this.io.Writer.WriteLine();
        }