Beispiel #1
0
        static int Main(string[] args)
        {
            try
            {
                var parser = new ApplicationArgumentsParser();
                var result = parser.Parse(args);

                if (result.HasErrors || result.AdditionalOptionsFound.Any())
                {
                    parser.ShowHelp();
                    return (int) ReturnCode.ArgumentsError;
                }

                ChooseOperation(parser);
                return (int) ReturnCode.Success;
            }
            catch (SchedulerException ex)
            {
                Console.Error.WriteLine(ex.Message);
                return (int) ReturnCode.Exception;
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.ToString());
                return (int) ReturnCode.Exception;
            }
        }