private static int Main(string[] args) { BottleFiles.ContentFolder = FubuMvcPackageFacility.FubuContentFolder; BottleFiles.PackagesFolder = FubuMvcPackageFacility.FubuPackagesFolder; try { var factory = new CommandFactory(); factory.RegisterCommands(typeof(IFubuCommand).Assembly); factory.RegisterCommands(typeof(Program).Assembly); var executor = new CommandExecutor(factory); success = executor.Execute(args); } catch (CommandFailureException e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + e.Message); Console.ResetColor(); return 1; } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + ex); Console.ResetColor(); return 1; } return success ? 0 : 1; }
public static int Main(string[] args) { BottleFiles.ContentFolder = FubuMvcPackageFacility.FubuContentFolder; BottleFiles.PackagesFolder = FileSystem.Combine("bin", FubuMvcPackageFacility.FubuPackagesFolder); try { var factory = new CommandFactory(); factory.RegisterCommands(typeof(AliasCommand).Assembly); factory.RegisterCommands(typeof(IFubuCommand).Assembly); factory.RegisterCommands(typeof(Program).Assembly); // TODO -- don't think this should be permanent factory.RegisterCommands(typeof(CreateVdirCommand).Assembly); var executor = new CommandExecutor(factory); success = executor.Execute(args); } catch (CommandFailureException e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + e.Message); Console.ResetColor(); return 1; } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + ex); Console.ResetColor(); return 1; } return success ? 0 : 1; }
private static int Main(string[] args) { try { var factory = new CommandFactory(); factory.RegisterCommands(typeof (Program).Assembly); var executor = new CommandExecutor(factory); success = executor.Execute(args); } catch (CommandFailureException e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + e.Message); Console.ResetColor(); return 1; } catch (RippleFatalError) { return 1; } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + ex); Console.ResetColor(); return 1; } return success ? 0 : 1; }
private static int Main(string[] args) { try { var factory = new CommandFactory(); factory.SetAppName("bottles"); factory.RegisterCommands(typeof(IFubuCommand).Assembly); factory.RegisterCommands(typeof(BottleExploder).Assembly); var executor = new CommandExecutor(factory); success = executor.Execute(args); } catch (CommandFailureException e) { Console.ForegroundColor = ConsoleColor.Red; ConsoleWriter.Write("ERROR: " + e.Message); Console.ResetColor(); return 1; } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; ConsoleWriter.Write("ERROR: " + ex); Console.ResetColor(); return 1; } return success ? 0 : 1; }
public static int Main(string[] args) { try { var factory = new CommandFactory(); factory.RegisterCommands(typeof(IFubuCommand).Assembly); factory.RegisterCommands(typeof(FolderInput).Assembly); var executor = new CommandExecutor(factory); success = executor.Execute(args); } catch (CommandFailureException e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + e.Message); Console.ResetColor(); return 1; } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + ex); Console.ResetColor(); return 1; } return success ? 0 : 1; }
public static int Main(string[] args) { try { var factory = new CommandFactory(); factory.RegisterCommands(typeof (IFubuCommand).Assembly); factory.RegisterCommands(typeof (Program).Assembly); // TODO -- don't think this should be permanent factory.RegisterCommands(typeof (StringToken).Assembly); var executor = new CommandExecutor(factory); success = executor.Execute(args); } catch (CommandFailureException e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + e.Message); Console.ResetColor(); return 1; } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + ex); Console.ResetColor(); return 1; } return success ? 0 : 1; }
public static int Main(string[] args) { // Try to magically determine the FubuMvcPackage folder here try { var factory = new CommandFactory(); factory.RegisterCommands(typeof(Program).Assembly); var executor = new CommandExecutor(factory); success = executor.Execute(args); } catch (CommandFailureException e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + e.Message); Console.ResetColor(); return 1; } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + ex); Console.ResetColor(); return 1; } return success ? 0 : 1; }
protected static void DefaultExecution(string[] args) { var commands = Bootstrap(Assembly.GetCallingAssembly()); var executor = new CommandExecutor(commands); if (args.Length > 0) executor.Execute(args); else executor.Execute("help"); }
public void SetUp() { factory = MockRepository.GenerateMock<ICommandFactory>(); command = MockRepository.GenerateMock<IFubuCommand>(); theInput = new object(); commandLine = "some stuff here"; theExecutor = new CommandExecutor(factory); }
private static void Main(string[] args) { var factory = new CommandFactory(); factory.RegisterCommands(typeof (IFubuCommand).Assembly); factory.RegisterCommands(typeof (Program).Assembly); var executor = new CommandExecutor(factory); executor.Execute(args); }
static void Main(string[] args) { ConsoleApp.MoveWindow(25, 25); var commands = Bootstrap(); var executor = new CommandExecutor(commands); var command = Help(executor); while (command != "exit") { executor.Execute(command); command = Help(executor); } }
public void try_to_create_a_package() { var factory = new CommandFactory(); factory.RegisterCommands(typeof(IFubuCommand).Assembly); factory.RegisterCommands(typeof(CreatePackageCommand).Assembly); var atRoot = false; var directory = Environment.CurrentDirectory; while(!atRoot) { directory = new DirectoryInfo(directory).Parent.FullName; atRoot = Directory.Exists(Path.Combine(directory, "src")); } Environment.CurrentDirectory = directory; var executor = new CommandExecutor(factory); executor.Execute("init-pak src/TestPackage4 pak4"); executor.Execute("create-pak pak4 pak4.zip -f"); }
private static int Main(string[] args) { try { var factory = new CommandFactory(); factory.RegisterCommands(typeof (IFubuCommand).Assembly); factory.RegisterCommands(typeof (Program).Assembly); var executor = new CommandExecutor(factory); executor.Execute(args); } catch(Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("ERROR: " + ex); Console.ResetColor(); return 1; } return 0; }
private static string Help(CommandExecutor executor) { executor.Execute("help"); var command = Console.ReadLine(); return command; }