コード例 #1
0
ファイル: Program.cs プロジェクト: Memmo/fubumvc
        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;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: jemacom/fubumvc
        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;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: ventaur/ripple
        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;
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: wbinford/bottles
        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;
        }
コード例 #5
0
        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;
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: henninga/fubulocalization
        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;
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: ventaur/FubuWorld
        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;
        }
コード例 #8
0
 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");
 }
コード例 #9
0
        public void SetUp()
        {
            factory = MockRepository.GenerateMock<ICommandFactory>();
            command = MockRepository.GenerateMock<IFubuCommand>();
            theInput = new object();
            commandLine = "some stuff here";

            theExecutor = new CommandExecutor(factory);
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: sbartlett/fubumvc
        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);
        }
コード例 #11
0
        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);
            }
        }
コード例 #12
0
ファイル: debugger.cs プロジェクト: RobertTheGrey/fubumvc
        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");
        }
コード例 #13
0
ファイル: Program.cs プロジェクト: nhsevidence/fubumvc
        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;
        }
コード例 #14
0
 private static string Help(CommandExecutor executor)
 {
     executor.Execute("help");
     var command = Console.ReadLine();
     return command;
 }