class ModelGeneration {

    public void parseCommandLine(String[] args) throws IOException {
        Options options = CommandLineParameters.getCommandLineOptions();
        CommandLine commands = parseCommands(args, options);
        if(commands.hasOption(HELP_OPT)) {
            printHelpMessage(options);
        } else if(commands.hasOption(PROJECT_CP_OPT)) { // Generate the model for passed cps
            // Get EvoSuite compatible class path
            String cp = commands.getOptionValue(PROJECT_CP_OPT);
            List<String> classPathEntries = ClassPaths.getClassPathEntries(cp);

            CallSequenceCollector callSequenceCollector =
                    new CallSequenceCollector(classPathEntries.toArray(new String[classPathEntries.size()]));

            String outputFolder = commands.hasOption(OUTPUT_FOLDER) ? commands.getOptionValue(OUTPUT_FOLDER) :
                    "generated_results";

            List<String> involvedObejcts = new ArrayList<>();
            if(commands.hasOption(CRASHES)) {
                Gson gson = new Gson();
                ArrayList<String> crashes = gson.fromJson(commands.getOptionValue(CRASHES), ArrayList.class);
                LogReader logReader = new LogReader(crashes);
                involvedObejcts = logReader.collectInvolvedObjects();
            } else if(commands.hasOption(LIST_CLASSES)) {
                File listClasses = new File(commands.getOptionValue(LIST_CLASSES));
                involvedObejcts = Files.readAllLines(listClasses.toPath());
            }

            // set project prefix
            if(commands.hasOption(PROJECT_PREFIX) ^ commands.hasOption(PROJECT_PACKAGE)) {
                if(commands.hasOption(PROJECT_PREFIX)) {
                    callSequenceCollector.collect(commands.getOptionValue(PROJECT_PREFIX), outputFolder,
                            involvedObejcts, true);
                } else {
                    callSequenceCollector.collect(commands.getOptionValue(PROJECT_PACKAGE), outputFolder,
                            involvedObejcts, false);
                }

                // Here, we have the list of call sequences. We just need to pass it to the yami tool
                ModelGenerator modelGenerator = new ModelGenerator();

                try {
                    modelGenerator.generate(CallSequencesPoolManager.getInstance().getPool(), Paths.get(outputFolder,
                            "models").toString());
                } catch(SessionBuildException e) {
                    LOG.error("Exception while building a session to learn the model!", e);
                }

            } else {
                LOG.error("Either project prefix or project package name should be passed as an input. For more " +
                        "information, use -" + HELP_OPT);
            }
        } else {
            LOG.error("Project classpath should be passed as an input. For more information -> help");
        }
    }

}