Exemple #1
0
        protected override ExitCode ExecuteInternal()
        {
            string input = null;
            do
            {
                this.consoleService.Write(this.prompt);
                input = Environment.ExpandEnvironmentVariables(this.consoleService.ReadLine().Trim());
                if (InteractiveTask.quitCommands.Contains(input, StringComparer.OrdinalIgnoreCase)) break;
                CommandLineParser parser = new CommandLineParser();
                parser.Parse(Strings.SplitCommandLine(input).ToArray());
                IArgumentProvider argumentProvider = ArgumentSettingsProvider.Create(parser);
                ConsoleTaskExecution execution = new ConsoleTaskExecution(argumentProvider, this.registry);
                execution.ExecuteTask();
            } while (true);

            return ExitCode.Success;
        }
Exemple #2
0
        static int Main(string[] args)
        {
            ExitCode result = ExitCode.GeneralFailure;

            CommandLineParser parser = new CommandLineParser();
            parser.Parse(args);

            IArgumentProvider argumentProvider = ArgumentSettingsProvider.Create(parser);

            using (ITaskService taskService = XFileTaskService.Create())
            {
                ConsoleTaskExecution execution = new ConsoleTaskExecution(argumentProvider, taskService.TaskRegistry);
                result = execution.ExecuteTask();
            }

            return (int)result;
        }
Exemple #3
0
        protected override ExitCode ExecuteInternal()
        {
            string input = null;

            do
            {
                _consoleService.Write(_prompt);
                input = Environment.ExpandEnvironmentVariables(_consoleService.ReadLine().Trim());
                if (s_QuitCommands.Contains(input, StringComparer.OrdinalIgnoreCase))
                {
                    break;
                }
                CommandLineParser parser = new CommandLineParser(GetService <IFileService>());
                parser.Parse(Strings.SplitCommandLine(input).ToArray());
                IArgumentProvider    argumentProvider = ArgumentSettingsProvider.Create(parser, GetService <IConfigurationManager>(), GetService <IFileService>());
                ConsoleTaskExecution execution        = new ConsoleTaskExecution(argumentProvider, _registry);
                execution.ExecuteTask();
            } while (true);

            return(ExitCode.Success);
        }