@@ -0,0 +1,1713 @@
+package helpers;%0A%0Aimport org.apache.commons.cli.*;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A/**%0A * Parse command line arguments.%0A */%0Apublic class CommandLineArgumentParser %7B%0A    private static Logger logger = LoggerFactory.getLogger(CommandLineArgumentParser.class);%0A    private String%5B%5D args;%0A    private Options options = new Options();%0A%0A    /**%0A     * Initialize options supported by the program.%0A     *%0A     * @param args program arguments.%0A     */%0A    public CommandLineArgumentParser(String%5B%5D args) %7B%0A        this.args = args;%0A        options.addOption(%22h%22, %22help%22, false, %22Show help%22);%0A        options.addOption(%22p%22, %22pidFile%22, true, %22Set file to store PID.%22);%0A    %7D%0A%0A    /**%0A     * Parse program arguments.%0A     */%0A    public void parse() %7B%0A        CommandLineParser parser = new BasicParser();%0A        CommandLine cmd = null;%0A%0A        try %7B%0A            cmd = parser.parse(options, args);%0A%0A            if (cmd.hasOption(%22h%22)) %7B%0A                help();%0A            %7D%0A%0A            String pidFile = null;%0A            if (cmd.hasOption(%22p%22)) %7B%0A                pidFile = cmd.getOptionValue(%22p%22);%0A                if (pidFile.length() %3E 0) %7B%0A                    PidManipulation.writeOwnPidToFile(pidFile);%0A                %7D%0A            %7D%0A            else %7B%0A                PidManipulation.writeOwnPidToFile(%22../var/specs_monitoring_nmap_frontend.pid%22);%0A            %7D%0A%0A        %7D catch (ParseException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    /**%0A     * Print help messages.%0A     */%0A    private void help() %7B%0A        HelpFormatter formatter = new HelpFormatter();%0A        formatter.printHelp(%22java -jar frontend.jar %5Barguments%5D %5Bfile%5D%22, options);%0A        System.exit(0);%0A    %7D%0A%7D%0A

Add class for command line argument manipulation.