private static int OnParse(GlobalOptions globals, object opts) { var parsedOptions = SmiCliInit.Verify <TriggerUpdatesCliOptions>(opts); ITriggerUpdatesSource source = parsedOptions switch { TriggerUpdatesFromMapperOptions o => new MapperSource(globals, o), TriggerUpdatesFromMongoOptions o => new MongoSource(globals, o), _ => throw new NotImplementedException($"No case for '{parsedOptions.GetType()}'") }; var bootstrapper = new MicroserviceHostBootstrapper(() => new TriggerUpdatesHost(globals, source)); int ret = bootstrapper.Main(); return(ret); } }
public MongoSource(GlobalOptions globalOptions, TriggerUpdatesFromMongoOptions cliOptions) { _cliOptions = cliOptions; }