Пример #1
0
        private static int ExecuteOperationByInputOptions(CommandLineOptions options)
        {
            int exitCode = 0;

            switch (options.Operation)
            {
            case Operation.ShowHelp:
                CommandLineParser.PrintUsage();
                exitCode = 0;
                break;

            case Operation.ListRules:

                var ruleRunner = new RuleRunner();
                ruleRunner.RunListRules();

                exitCode = 0;
                break;

            case Operation.Format:

                var formatRunner = new FormatRunner();
                exitCode = formatRunner.RunFormat(options);

                break;

            default:
                throw new Exception("Invalid enum value: " + options.Operation);
            }
            return(exitCode);
        }