Exemplo n.º 1
0
        public static RuntimeConfiguration FromCommandLineArguments(string[] args)
        {
            var rc = new RuntimeConfiguration();

            // http://fclp.github.io/fluent-command-line-parser/
            var p = new FluentCommandLineParser();

            List <string> controllers = null;

            p.Setup <List <string> >('c', "controllers")
            .Callback(items => controllers = items);

            var result = p.Parse(args);

            if (result.HasErrors)
            {
                throw new AggregateException(result.ErrorText, result.Errors.Select(e => new Exception(e.ToString())));
            }

            rc._controllersToTranslate = controllers?
                                         .Select(c => c.ToLower())
                                         .ToHashSet();

            return(rc);
        }
Exemplo n.º 2
0
        public QuokkaContainer WithRuntimeConfiguration(RuntimeConfiguration runtimeConfiguration)
        {
            EnsureNotInitialized();

            _builder
            .RegisterInstance(runtimeConfiguration)
            .SingleInstance();

            return(this);
        }