// Path: src/main/java/uk/ac/tgac/rampart/util/CommandLineHelper.java
// public class CommandLineHelper {
// 
//     public static void printHelp(OutputStream outputStream, String title, String description, Options options) {
//         final PrintWriter writer = new PrintWriter(outputStream);
//         final HelpFormatter helpFormatter = new HelpFormatter();
//         helpFormatter.printHelp(
//                 writer,
//                 100,
//                 title,
//                 description,
//                 options,
//                 3,
//                 3,
//                 "Created by The Genome Analysis Centre (TGAC), Norwich, UK\n" +
//                 "Contact: daniel.mapleson@tgac.ac.uk",
//                 true);
//         writer.flush();
//     }
// }


import org.apache.commons.cli.*;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.ac.ebi.fgpt.conan.core.user.GuestUser;
import uk.ac.ebi.fgpt.conan.model.ConanPipeline;
import uk.ac.ebi.fgpt.conan.model.ConanTask;
import uk.ac.ebi.fgpt.conan.model.context.ExecutionContext;
import uk.ac.ebi.fgpt.conan.model.param.ParamMap;
import uk.ac.ebi.fgpt.conan.properties.ConanProperties;
import uk.ac.ebi.fgpt.conan.service.DefaultExecutorService;
import uk.ac.ebi.fgpt.conan.service.DefaultProcessService;
import uk.ac.ebi.fgpt.conan.service.exception.TaskExecutionException;
import uk.ac.ebi.fgpt.conan.util.AbstractConanCLI;
import uk.ac.tgac.conan.core.util.JarUtils;
import uk.ac.tgac.rampart.util.CommandLineHelper;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

        this.memory = commandLine.hasOption(OPT_MEMORY) ?
                Integer.parseInt(commandLine.getOptionValue(OPT_MEMORY)) :
                DEFAULT_MEMORY;

        this.recursive = commandLine.hasOption(OPT_RECURSIVE);

        this.single = commandLine.hasOption(OPT_SINGLE);

        // Check for a single arg left on the command line
        if (commandLine.getArgs().length != 1)
            throw new ParseException("Unexpected number of arguments on the command line.  Expected 1, found " +
                    commandLine.getArgs().length);

        // This is the input directory containing libraries to analyse.
        this.inputDir = new File(commandLine.getArgs()[0]);
    }

    @Override
    protected ParamMap createArgMap() {
        return this.args.getArgMap();
    }

    @Override
    protected ConanPipeline createPipeline() throws IOException {
        return new Jellyswarm.Pipeline(this.args, new DefaultExecutorService(new DefaultProcessService(), this.executionContext));
    }

    @Override
    protected void printHelp() {
// Path: src/main/java/uk/ac/tgac/rampart/util/CommandLineHelper.java
// public class CommandLineHelper {
// 
//     public static void printHelp(OutputStream outputStream, String title, String description, Options options) {
//         final PrintWriter writer = new PrintWriter(outputStream);
//         final HelpFormatter helpFormatter = new HelpFormatter();
//         helpFormatter.printHelp(
//                 writer,
//                 100,
//                 title,
//                 description,
//                 options,
//                 3,
//                 3,
//                 "Created by The Genome Analysis Centre (TGAC), Norwich, UK\n" +
//                 "Contact: daniel.mapleson@tgac.ac.uk",
//                 true);
//         writer.flush();
//     }
// }


// Path: src/main/java/uk/ac/tgac/jellyswarm/JellyswarmCLI.java
import org.apache.commons.cli.*;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.ac.ebi.fgpt.conan.core.user.GuestUser;
import uk.ac.ebi.fgpt.conan.model.ConanPipeline;
import uk.ac.ebi.fgpt.conan.model.ConanTask;
import uk.ac.ebi.fgpt.conan.model.context.ExecutionContext;
import uk.ac.ebi.fgpt.conan.model.param.ParamMap;
import uk.ac.ebi.fgpt.conan.properties.ConanProperties;
import uk.ac.ebi.fgpt.conan.service.DefaultExecutorService;
import uk.ac.ebi.fgpt.conan.service.DefaultProcessService;
import uk.ac.ebi.fgpt.conan.service.exception.TaskExecutionException;
import uk.ac.ebi.fgpt.conan.util.AbstractConanCLI;
import uk.ac.tgac.conan.core.util.JarUtils;
import uk.ac.tgac.rampart.util.CommandLineHelper;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;


        this.memory = commandLine.hasOption(OPT_MEMORY) ?
                Integer.parseInt(commandLine.getOptionValue(OPT_MEMORY)) :
                DEFAULT_MEMORY;

        this.recursive = commandLine.hasOption(OPT_RECURSIVE);

        this.single = commandLine.hasOption(OPT_SINGLE);

        // Check for a single arg left on the command line
        if (commandLine.getArgs().length != 1)
            throw new ParseException("Unexpected number of arguments on the command line.  Expected 1, found " +
                    commandLine.getArgs().length);

        // This is the input directory containing libraries to analyse.
        this.inputDir = new File(commandLine.getArgs()[0]);
    }

    @Override
    protected ParamMap createArgMap() {
        return this.args.getArgMap();
    }

    @Override
    protected ConanPipeline createPipeline() throws IOException {
        return new Jellyswarm.Pipeline(this.args, new DefaultExecutorService(new DefaultProcessService(), this.executionContext));
    }

    @Override
    protected void printHelp() {
        CommandLineHelper.printHelp(