Beispiel #1
0
        private async Task <CommandReturnCodes> DoRunAsync()
        {
            var context = CommandHostContext();

            if (context.DisplayUsageHelp)
            {
                await DisplayUsageHelpAsync();

                return(CommandReturnCodes.Ok);
            }
            if (context.StartSessionResult == CommandReturnCodes.Fail)
            {
                _commandHostContextProvider.Shutdown(context);
                return(context.StartSessionResult);
            }

            CommandReturnCodes result = CommandReturnCodes.Fail;

            //if (context.Arguments.Arguments.Any())
            //    result = ExecuteSingleCommand(context);
            //else if (context.Arguments.ResponseFiles.Any())
            //    result = ExecuteResponseFiles(context);
            //else {
            result = await ExecuteInteractiveAsync(context);

            //}

            _commandHostContextProvider.Shutdown(context);
            return(result);
        }
Beispiel #2
0
        private CommandReturnCodes DoRun()
        {
            var context = CommandHostContext();

            if (context.DisplayUsageHelp)
            {
                DisplayUsageHelp();
                return(CommandReturnCodes.Ok);
            }
            if (context.StartSessionResult == CommandReturnCodes.Fail)
            {
                _commandHostContextProvider.Shutdown(context);
                return(context.StartSessionResult);
            }

            CommandReturnCodes result;

            if (context.Arguments.Arguments.Any())
            {
                result = ExecuteSingleCommand(context);
            }
            else if (context.Arguments.ResponseFiles.Any())
            {
                result = ExecuteResponseFiles(context);
            }
            else
            {
                result = ExecuteInteractive(context);
            }

            _commandHostContextProvider.Shutdown(context);
            return(result);
        }