<commit_before>package jbossexploit;

import org.apache.commons.cli.*;

public class Cli {

    public static org.apache.commons.cli.CommandLine parseArguments(String[] args) {
        // Set up CLI options

        Option help = new Option("help",  "print this message");
        Option rhost = OptionBuilder.withArgName("host")
                .hasArg()
                .withDescription("Target Hostname or IP Address")
                .create("rhost");

        Option rport = OptionBuilder.withArgName("port")
                .hasArg()
                .withDescription("Remote JBoss Port")
                .create("rport");

        Option lhost = OptionBuilder.withArgName("host")
                .hasArg()
                .withDescription("IP Address of Attacking Machine")
                .create("lhost");

        Option lport = OptionBuilder.withArgName("port")
                .hasArg()
                .withDescription("Port on which local handler is listening for a reverse TCP shell")
                .create("lport");

        Option srvport = OptionBuilder.withArgName("port")
                .hasArg()
                .withDescription("Port for local HTTP server")
                .create("srvport");

        Options options = new Options();

        options.addOption(help);
        options.addOption(rhost);
        options.addOption(rport);
        options.addOption(lhost);
        options.addOption(lport);
        options.addOption(srvport);

        CommandLineParser parser = new DefaultParser();
        org.apache.commons.cli.CommandLine cmd = null;
        try {
            cmd = parser.parse(options, args);
        } catch (Exception e) {
            System.out.println("Error parsing arguments.");
            System.exit(1);
        }

        // TODO: Print usage if no arguments are called from CLI
        if (cmd.hasOption("help")) {<commit_msg>Print help menu when no args are passed from the CLI<commit_after>package jbossexploit;

import org.apache.commons.cli.*;

public class Cli {

    public static org.apache.commons.cli.CommandLine parseArguments(String[] args) {
        // Set up CLI options

        Option help = new Option("help",  "Print this message");
        Option rhost = OptionBuilder.withArgName("host")
                .hasArg()
                .withDescription("Target Hostname or IP Address")
                .create("rhost");

        Option rport = OptionBuilder.withArgName("port")
                .hasArg()
                .withDescription("Remote JBoss Port")
                .create("rport");

        Option lhost = OptionBuilder.withArgName("host")
                .hasArg()
                .withDescription("IP Address of Attacking Machine")
                .create("lhost");

        Option lport = OptionBuilder.withArgName("port")
                .hasArg()
                .withDescription("Port on which local handler is listening for a reverse TCP shell")
                .create("lport");

        Option srvport = OptionBuilder.withArgName("port")
                .hasArg()
                .withDescription("Port for local HTTP server")
                .create("srvport");

        Options options = new Options();

        options.addOption(help);
        options.addOption(rhost);
        options.addOption(rport);
        options.addOption(lhost);
        options.addOption(lport);
        options.addOption(srvport);

        CommandLineParser parser = new DefaultParser();
        org.apache.commons.cli.CommandLine cmd = null;
        try {
            cmd = parser.parse(options, args);
        } catch (Exception e) {
            System.out.println("Error parsing arguments.");
            System.exit(1);
        }

        if (cmd.hasOption("help") || args.length == 0) {
{'fraction_non_alphanumeric': 0.10904255319148937, 'fraction_numerical': 0.0007978723404255319, 'mean_word_length': 1.9268482490272374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2870075', 'n_tokens_mistral': 989, 'n_tokens_neox': 927, 'n_words': 238}