<commit_before>package com.tngtech.jenkins.notification;

import com.tngtech.jenkins.notification.camel.CamelApplication;
import com.tngtech.jenkins.notification.endpoints.MissileEndpoint;
import com.tngtech.jenkins.notification.endpoints.TtsEndpoint;
import com.tngtech.jenkins.notification.model.Config;
import com.tngtech.missile.usb.MissileController;
import com.tngtech.missile.usb.MissileLauncher;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Bootstrap {

    public static void main(String[] args) throws Exception {

        Config config = new ConfigLoader().load();

        String command = args[0];
        if (args.length == 1) {
            switch (command) {
                case "fire":
                    getMissileController().fire();
                    break;
                case "ledOn":
                    getMissileController().ledOn();
                    break;
                case "ledOff":
                    getMissileController().ledOff();
                    break;
                case "stalk":
                    new CamelApplication(config).run();
                    break;
                default:
                    throw new IllegalArgumentException("Could not parse commandline");
            }
        }
        if (args.length >= 2) {
            switch (command) {
                case "shootAt":
                    MissileEndpoint missileEndpoint = new MissileEndpoint(config.getMissile());
                    List<String> culprits = new ArrayList<>();
                    culprits.addAll(Arrays.asList(args).subList(1, args.length));
                    missileEndpoint.shootAt(culprits);
                    break;
                case "say":
                    TtsEndpoint ttsEndpoint = new TtsEndpoint(config.getTts());
                    StringBuilder text = new StringBuilder("");
                    for (int i = 1; i < args.length; i++) {
                        text.append(" ").append(args[i]);
                    }
                    ttsEndpoint.say(text.toString());
                    break;
                default:
                    MissileLauncher.Command direction =
                            MissileLauncher.Command.valueOf(args[0].toUpperCase());
                    int time = Integer.parseInt(args[1]);
                    getMissileController().move(direction, time);
                    break;
            }
        }
    }

    private static MissileController getMissileController() throws Exception {
        return new MissileController(MissileLauncher.findMissileLauncher());
    }
}
<commit_msg>Fix say command line call<commit_after>package com.tngtech.jenkins.notification;

import com.tngtech.jenkins.notification.camel.CamelApplication;
import com.tngtech.jenkins.notification.endpoints.MissileEndpoint;
import com.tngtech.jenkins.notification.endpoints.TtsEndpoint;
import com.tngtech.jenkins.notification.model.Config;
import com.tngtech.missile.usb.MissileController;
import com.tngtech.missile.usb.MissileLauncher;
import org.apache.commons.lang.ArrayUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Bootstrap {

    public static void main(String[] args) throws Exception {

        Config config = new ConfigLoader().load();

        String command = args[0];
        if (args.length == 1) {
            switch (command) {
                case "fire":
                    getMissileController().fire();
                    break;
                case "ledOn":
                    getMissileController().ledOn();
                    break;
                case "ledOff":
                    getMissileController().ledOff();
                    break;
                case "stalk":
                    new CamelApplication(config).run();
                    break;
                default:
                    throw new IllegalArgumentException("Could not parse commandline");
            }
        }
        if (args.length >= 2) {
            switch (command) {
                case "shootAt":
                    MissileEndpoint missileEndpoint = new MissileEndpoint(config.getMissile());
                    List<String> culprits = new ArrayList<>();
                    culprits.addAll(Arrays.asList(args).subList(1, args.length));
                    missileEndpoint.shootAt(culprits);
                    break;
                case "say":
                    TtsEndpoint ttsEndpoint = new TtsEndpoint(config.getTts());
                    List<String> words = new ArrayList<>(Arrays.asList(args));
                    words.remove(0);
                    ttsEndpoint.say(words);
                    break;
                default:
                    MissileLauncher.Command direction =
                            MissileLauncher.Command.valueOf(args[0].toUpperCase());
                    int time = Integer.parseInt(args[1]);
                    getMissileController().move(direction, time);
                    break;
            }
        }
    }

    private static MissileController getMissileController() throws Exception {
        return new MissileController(MissileLauncher.findMissileLauncher());
    }
}

{'fraction_non_alphanumeric': 0.09603220241518114, 'fraction_numerical': 0.0026835345984282154, 'mean_word_length': 1.6636038795303727, 'pattern_counts': {'":': 12, '<': 10, '<?xml version=': 0, '>': 11, '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': '2495948', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1242, 'n_words': 248}