Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler);

            Printer.PrinterStream printerStream = new Printer.PrinterStream();
            Parser parser = new Parser(new Action<ParserSettings>(
                (ParserSettings p) => { p.CaseSensitive = false; p.IgnoreUnknownArguments = false; p.HelpWriter = printerStream; p.MutuallyExclusive = true; }));

            Options = new LogrOptions();
            if (!parser.ParseArguments(args, Options))
            {
                printerStream.Flush();
                Printer.RestoreDefaults();
                Environment.Exit(CommandLine.Parser.DefaultExitCodeFail);
            }
            
            Log log = new Log(Options.Repo, Options.LogFile, (Options.Limit > 0) ? Options.Limit : (int?)null);
            log.Update();
            log.Serialize();
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler);

            Printer.PrinterStream printerStream = new Printer.PrinterStream();
            Parser parser = new Parser(new Action <ParserSettings>(
                                           (ParserSettings p) => { p.CaseSensitive = false; p.IgnoreUnknownArguments = false; p.HelpWriter = printerStream; p.MutuallyExclusive = true; }));

            Options = new LogrOptions();
            if (!parser.ParseArguments(args, Options))
            {
                printerStream.Flush();
                Printer.RestoreDefaults();
                Environment.Exit(CommandLine.Parser.DefaultExitCodeFail);
            }

            Log log = new Log(Options.Repo, Options.LogFile, (Options.Limit > 0) ? Options.Limit : (int?)null);

            log.Update();
            log.Serialize();
        }