示例#1
0
        private static int Main(string[] args)
        {
            TextWriter outputWriter = Console.Out;

              try
              {
            Bootstraper.Bootstrap();

            var commandDispatcher = new CommandDispatcher(outputWriter);

            commandDispatcher.DiscoverCommands(Assembly.GetExecutingAssembly());

            if (args.Length == 0)
            {
              commandDispatcher.DisplayAvailableCommands();

              return 1;
            }

            return commandDispatcher.Dispatch(args);
              }
              catch (Exception exc)
              {
            outputWriter.WriteLine(exc);

            return 1;
              }
        }
示例#2
0
        private static int Main(string[] args)
        {
            GlobalContext.Properties["applicationName"] = "UberDeployer.ConsoleApp";
              XmlConfigurator.Configure();

              TextWriter outputWriter = Console.Out;

              try
              {
            Bootstraper.Bootstrap();

            var commandDispatcher = new CommandDispatcher(outputWriter);

            commandDispatcher.DiscoverCommands(Assembly.GetExecutingAssembly());

            if (args.Length == 0)
            {
              commandDispatcher.DisplayAvailableCommands();

              return 1;
            }

            return commandDispatcher.Dispatch(args);
              }
              catch (Exception exc)
              {
            outputWriter.WriteLine(exc);

            return 1;
              }
        }