public RegisterCommands ( |
||
assembly | ||
리턴 | void |
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.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; }
private static ICommandFactory Bootstrap() { var commands = new CommandFactory(); commands.RegisterCommands(typeof(IFubuCommand).Assembly); commands.RegisterCommands(Assembly.GetExecutingAssembly()); return commands; }
public static int Main(string[] args) { try { var factory = new CommandFactory(); factory.RegisterCommands(typeof (RunCommand).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; }
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); }
public void Execute(string command) { var factory = new CommandFactory(); factory.RegisterCommands(typeof (NewCommand).Assembly); factory.BuildRun(command).Execute(); }
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; }
public void all_commands_usage_graph_works() { var factory = new CommandFactory(); factory.RegisterCommands(typeof(AliasCommand).Assembly); factory.RegisterCommands(typeof(IFubuCommand).Assembly); factory.AllCommandTypes().Each(t => { try { var usageGraph = new UsageGraph(t); usageGraph.WriteUsages(); Assert.IsTrue(usageGraph.Usages.Any(), "Found usages for " + t.FullName); } catch (Exception e) { throw new ApplicationException("Command type: " + t.FullName, e); } }); }
private static int Main(string[] args) { try { RippleApplication.Start(); 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; } finally { RippleApplication.Stop(); } return success ? 0 : 1; }
protected static ICommandFactory Bootstrap(Assembly assembly) { var commandFactory = new CommandFactory(); commandFactory.RegisterCommands(assembly); return commandFactory; }