예제 #1
0
        public static int Main(string[] args)
        {
            var options = Args.Parse <UpgradeProjectionOptions>(args);

            if (options.Help)
            {
                Console.Write(ArgUsage.GetUsage <UpgradeProjectionOptions>());
                return(0);
            }
            try
            {
                var upgrade = new UpgradeProjectionsWorker(
                    IPAddress.Parse(options.Ip), options.Port, options.UserName, options.Password, options.Upgrade);
                upgrade.RunUpgrade();
                return(0);
            }
            catch (AggregateException ex)
            {
                Console.Error.WriteLine(ex.Message);
                foreach (var inner in ex.InnerExceptions)
                {
                    Console.Error.WriteLine(inner.Message);
                }
                return(1);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                return(1);
            }
        }
예제 #2
0
 public static int Main(string[] args)
 {
     var unrecognized = _parser.Parse(args);
     if (_helpInvoked) 
         return 0;
     if (unrecognized.Count > 0)
     {
         Console.Error.WriteLine("Unrecognized command line: {0}", unrecognized.First());
         Usage();
         return 1;
     }
     try
     {
         var upgrade = new UpgradeProjectionsWorker(
             IPAddress.Parse(_ipString), _port, _userName, _password, _runUpgrade);
         upgrade.RunUpgrade();
         return 0;
     }
     catch (AggregateException ex)
     {
         Console.Error.WriteLine(ex.Message);
         foreach (var inner in ex.InnerExceptions)
         {
             Console.Error.WriteLine(inner.Message);
         }
         return 1;
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine(ex.Message);
         return 1;
     }
 }
예제 #3
0
 public static int Main(string[] args)
 {
     var options = Args.Parse<UpgradeProjectionOptions>(args);
     if (options.Help)
     {
         Console.Write(ArgUsage.GetUsage<UpgradeProjectionOptions>());
         return 0;
     }
     try
     {
         var upgrade = new UpgradeProjectionsWorker(
             IPAddress.Parse(options.Ip), options.Port, options.UserName, options.Password, options.Upgrade);
         upgrade.RunUpgrade();
         return 0;
     }
     catch (AggregateException ex)
     {
         Console.Error.WriteLine(ex.Message);
         foreach (var inner in ex.InnerExceptions)
         {
             Console.Error.WriteLine(inner.Message);
         }
         return 1;
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine(ex.Message);
         return 1;
     }
 }
예제 #4
0
        public static int Main(string[] args)
        {
            var unrecognized = _parser.Parse(args);

            if (_helpInvoked)
            {
                return(0);
            }
            if (unrecognized.Count > 0)
            {
                Console.Error.WriteLine("Unrecognized command line: {0}", unrecognized.First());
                Usage();
                return(1);
            }
            try
            {
                var upgrade = new UpgradeProjectionsWorker(
                    IPAddress.Parse(_ipString), _port, _userName, _password, _runUpgrade);
                upgrade.RunUpgrade();
                return(0);
            }
            catch (AggregateException ex)
            {
                Console.Error.WriteLine(ex.Message);
                foreach (var inner in ex.InnerExceptions)
                {
                    Console.Error.WriteLine(inner.Message);
                }
                return(1);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                return(1);
            }
        }