Example #1
0
        public static void Main(string[] args)
        {
            Log.CreateLog();

            try
            {
                var options = new Options();

                var parser = new Parser(s => { s.HelpWriter = Console.Error; });

                if (!parser.ParseArguments(args, options))
                {
                    return;
                }

                if (string.Equals(options.Command, "DropCreateAagDatabase", StringComparison.InvariantCultureIgnoreCase))
                {
                    DropCreateDatabases(options);
                }
                else if (string.Equals(options.Command, "Backup", StringComparison.InvariantCultureIgnoreCase))
                {
                    Backup(options);
                }
                else if (string.Equals(options.Command, "Restore", StringComparison.InvariantCultureIgnoreCase))
                {
                    Restore(options);
                }
                else
                {
                    Log.LogError("Unknown command: {0}", options.Command);
                }
            }
            catch (Exception e)
            {
                Log.LogError("Error: {0}", e);
                throw;
            }
        }
Example #2
0
        Exception IDatabaseHelperLogger.NewException(string message, params object[] args)
        {
            _interface.LogError(message, args);

            return(new Exception(String.Format(message, args)));
        }