<commit_before>package biz.hahamo.dev.commandLine;

import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

public final class CLIExample {

    private CLIExample() {

    }

    public static void main(final String... args) {

        System.out.println("CLIExample is not yet implemented :( \n");
        Options options = new Options();

        Option outputPath = OptionBuilder.hasArg()
                .withDescription("Output path where the CSV file should be saved. Mandatory.").create("outputPath");
        outputPath.setRequired(true);

        Option outputFile = OptionBuilder.hasArg().withDescription("The name of the resulting CSV file. Mandatory.")
                .create("outputFile");

        outputFile.setRequired(true);

        // options.addOption(outputPath);
        // options.addOption(outputFile);

        options.addOption("t", "timeout", true, "Connection timeout in seconds. Optional.");
        options.addOption("h", "host", true, "Host of the proxy server. Optional. Example: 'http://localhost'");
        options.addOption("p", "port", true, "Port of the proxy server. Optional.");

        CommandLineParser parser = new BasicParser();
        try {
            CommandLine cmd = parser.parse(options, args);
            System.out.println(cmd.getArgList());

        } catch (ParseException e) {
            System.err.println(e.getMessage());
            HelpFormatter helpFormatter = new HelpFormatter();
            helpFormatter
                    .printHelp(
                            "java -jar commandLine.jar <output path> <output filename> [-t|--timeout connection timeout] [-h|--host proxy host] [-p|--port proxy port]",
                            options);
        }

    }
}<commit_msg>cli improvements<commit_after>package biz.hahamo.dev.commandLine;

import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

public final class CLIExample {

    private CLIExample() {

    }

    public static void main(final String... args) {

        System.out.println("CLIExample is not yet fully implemented :( \n");
        Options options = new Options();

        // example for OptionBuilder and required arguments
        // Option outputPath = OptionBuilder.hasArg()
        // .withDescription("Output path where the CSV file should be saved. Mandatory.").create("outputPath");
        // outputPath.setRequired(true);

        options.addOption("t", "timeout", true, "Connection timeout in seconds. Optional.");
        options.addOption("h", "host", true, "Host of the proxy server. Optional. Example: 'http://localhost'");
        options.addOption("p", "port", true, "Port of the proxy server. Optional.");

        CommandLineParser parser = new BasicParser();
        try {
            String errorText = "";
            CommandLine cmd = parser.parse(options, args);
            if (cmd.getArgList().size() < 1) {
                errorText = "ERROR: Parameter 'output path' is required.";
            }
            if (cmd.getArgList().size() < 2) {
                errorText = "ERROR: Parameter 'output filename' is required.";
            }
            if (errorText.length() != 0) {
                throw new ParseException(errorText);
            }

        } catch (ParseException e) {
            System.err.println(e.getMessage());
            printHelp(options);
            System.exit(-1);
        }

    }

    /**
     * @param options
     */
    private static void printHelp(final Options options) {

        HelpFormatter helpFormatter = new HelpFormatter();
        helpFormatter
                .printHelp(
                        "java -jar commandLine.jar <output path> <output filename> "
                                + "[(-t|--timeout) <connection timeout>] [(-h|--host) <proxy host>] "
                                + "[(-p|--port) <proxy port>] "
                                + "[other parameters1 other parameters2 ... other parametersN]",
                        options);
    }
}
{'fraction_non_alphanumeric': 0.1223760607414024, 'fraction_numerical': 0.0013398838767306833, 'mean_word_length': 2.2741228070175437, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '258694', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1117, 'n_words': 299}