<commit_before>﻿using System.Collections.Generic;
using CommandLine;
using log4net;
using Rhino.ServiceBus.Host.Actions;

namespace Rhino.ServiceBus.Host
{
    using System;

    public class Program
    {
        private static readonly IDictionary<Action, IAction> actions = new Dictionary<Action, IAction>
        {
            {Action.Debug, new DebugAction()},
            {Action.Server, new ServerAction()},
            {Action.Install, new InstallAction()},
            {Action.Uninstall, new UninstallAction()},
            {Action.Deploy, new DeployAction()}
        };

    	private static ILog log = LogManager.GetLogger(typeof (Program));

        public static void Main(string[] args)
        {
            var executingOptions = new ExecutingOptions();
            if (Parser.ParseArguments(args, executingOptions) == false)
            {
                Console.WriteLine("Invalid arguments:");
                Console.WriteLine("\t{0}",
                    string.Join(" ",args));
                Console.WriteLine();
                Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions)));
                return;
            }

            try
            {
                actions[executingOptions.Action].Execute(executingOptions);
            }
            catch (Exception e)
            {
                log.Fatal("Host has crashed because of an error",e);
				// want to put the error in the error log
				if(executingOptions.Action == Action.Server)
					throw;
            }
        }
    }
}<commit_msg>Added returning non-zero exit code on error in Rhino.ServiceBus.Host<commit_after>﻿using System.Collections.Generic;
using CommandLine;
using log4net;
using Rhino.ServiceBus.Host.Actions;

namespace Rhino.ServiceBus.Host
{
    using System;

    public class Program
    {
        private static readonly IDictionary<Action, IAction> actions = new Dictionary<Action, IAction>
        {
            {Action.Debug, new DebugAction()},
            {Action.Server, new ServerAction()},
            {Action.Install, new InstallAction()},
            {Action.Uninstall, new UninstallAction()},
            {Action.Deploy, new DeployAction()}
        };

    	private static ILog log = LogManager.GetLogger(typeof (Program));

        public static int Main(string[] args)
        {
            var executingOptions = new ExecutingOptions();
            if (Parser.ParseArguments(args, executingOptions) == false)
            {
                Console.WriteLine("Invalid arguments:");
                Console.WriteLine("\t{0}",
                    string.Join(" ",args));
                Console.WriteLine();
                Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions)));

                return 1;
            }

            try
            {
                actions[executingOptions.Action].Execute(executingOptions);

                return 0;
            }
            catch (Exception e)
            {
                log.Fatal("Host has crashed because of an error",e);
				// want to put the error in the error log
				if(executingOptions.Action == Action.Server)
					throw;

                return 2;
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.0997186620819006, 'fraction_numerical': 0.002188183807439825, 'mean_word_length': 1.8469750889679715, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6590500', 'n_tokens_mistral': 828, 'n_tokens_neox': 770, 'n_words': 193}