static int Main(string[] args) { try { // set up a simple configuration that logs on the console. log4net.Config.XmlConfigurator.Configure(); // command line parsing Options options = new Options(); if (!CommandLine.Parser.Default.ParseArguments(args, options)) { Console.WriteLine(options.GetUsage()); return -1; } string dbPath = options.InputFile; _log.Info(string.Format("db path = {0}", dbPath)); LegacyDBUploder uploader = new treeDiM.PLMPackLib.LegacyDBUploder(); LoggingCallback callback = new LoggingCallback(); uploader.DatabasePath = dbPath; uploader.UserName = options.UserName; uploader.Password = options.Password; uploader.ActuallyUpload = !options.Test; uploader.Upload(callback); } catch (Exception ex) { _log.Error(ex.ToString()); return -1; } return 0; }
static int Main(string[] args) { try { // set up a simple configuration that logs on the console. log4net.Config.XmlConfigurator.Configure(); // command line parsing Options options = new Options(); if (!CommandLine.Parser.Default.ParseArguments(args, options)) { Console.WriteLine(options.GetUsage()); return(-1); } string dbPath = options.InputFile; _log.Info(string.Format("db path = {0}", dbPath)); LegacyDBUploder uploader = new treeDiM.PLMPackLib.LegacyDBUploder(); LoggingCallback callback = new LoggingCallback(); uploader.DatabasePath = dbPath; uploader.UserName = options.UserName; uploader.Password = options.Password; uploader.ActuallyUpload = !options.Test; uploader.Upload(callback); } catch (Exception ex) { _log.Error(ex.ToString()); return(-1); } return(0); }