Ejemplo n.º 1
0
        public static IRunner BuildRunner(Action<IConfigurationHelper> configurator)
        {
            var configPlan = new ConfigurationPlan();

            if (configurator != null)
            {
                configurator(configPlan);
            }

            configPlan.Validate();

            var routingInfo = GetRoutingInfo(configPlan);

            routingInfo.Validate();

            var router = new CommandRouter(routingInfo);

            var argsHelper = new ArgsHelper(configPlan.SwitchDelimiter);
            var argsHelpProvider = new ArgsParameterHelpProvider(argsHelper);
            var argsParameterBinder = new ArgsParameterBinder(argsHelper);

            var helpProvider = new HelpProvider(router, argsHelpProvider);
            var cmdProcessor = new CommandProcessor(router, configPlan.TypeInstantiationStrategy, argsParameterBinder);

            return new RunnerInternal(helpProvider, cmdProcessor);
        }
Ejemplo n.º 2
0
 public ArgsParameterHelpProvider(ArgsHelper argsHelper)
 {
     _argsHelper = argsHelper;
 }
Ejemplo n.º 3
0
 public ArgsParameterBinder(ArgsHelper argsHelper)
 {
     _argsHelper = argsHelper;
 }