private static void RunWithArgString(ConsoleCommandExecutor executor, string args) { Console.WriteLine("----------------------------------------------------------"); Console.WriteLine("Running with args: " + args); var argArray = args == null ? new string[0] : args.Split(); executor.Execute(argArray); }
void ExecuteCommands() { var executor = new ConsoleCommandExecutor( ServiceLocator.GetService <IEnumerable <ICommandLocator> >(), ServiceLocator.GetService <IEventHub>(), ServiceLocator.GetService <ICommandOutputFormatter>()); foreach (var command in _commands) { executor.Execute(command, Enumerable.Empty <string>()); } }