public void init() throws ParseException {
        // preparing options
        this.options = new Options();

        @SuppressWarnings("static-access")
        Option help = OptionBuilder.withArgName(HELP_LONG)
                            .hasArg(false)
                            .isRequired(false)
                            .withDescription("show help")
                            .withLongOpt(HELP_LONG)
                            .create(HELP_SHORT);
        options.addOption(help);

        @SuppressWarnings("static-access")
        Option logfile = OptionBuilder.withArgName(LOG_FILE_PATH_LONG)
                            .hasArg(true)
                            .isRequired(false)
                            .withDescription("log file path")
                            .withLongOpt(LOG_FILE_PATH_LONG)
                            .create(LOG_FILE_PATH_SHORT);
        this.options.addOption(logfile);

        @SuppressWarnings("static-access")
        Option log_prop_file = OptionBuilder.withArgName(LOG_PROP_FILE_PATH_LONG)
                            .hasArg(true)
                            .isRequired(false)
                            .withDescription("log properties file")
                            .withLongOpt(LOG_PROP_FILE_PATH_LONG)
                            .create(LOG_PROP_FILE_PATH_SHORT);
        this.options.addOption(log_prop_file);

        @SuppressWarnings("static-access")
        Option basic_user = OptionBuilder.withArgName(BASIC_AUTH_USER_LONG)
                            .hasArg(true)
                            .isRequired(false)
                            .withDescription("username for HTTP BASIC AUTH")
                            .withLongOpt(BASIC_AUTH_USER_LONG)
                            .create();
        this.options.addOption(basic_user);

        @SuppressWarnings("static-access")
        Option basic_pass = OptionBuilder.withArgName(BASIC_AUTH_PASSWORD_LONG)
                            .hasArg(true)
                            .isRequired(false)
                            .withDescription("password for HTTP BASIC AUTH")
                            .withLongOpt(BASIC_AUTH_PASSWORD_LONG)
                            .create();
        this.options.addOption(basic_pass);

        @SuppressWarnings("static-access")
        Option user_agent = OptionBuilder.withArgName(USER_AGENT_LONG)
                            .hasArg(true)
                            .isRequired(false)
                            .withDescription("User-Agent header field")
                            .withLongOpt(USER_AGENT_LONG)
                            .create(USER_AGENT_SHORT);
        this.options.addOption(user_agent);

        CommandLineParser parser = new BasicParser();
        org.apache.commons.cli.CommandLine cl = null;

        try {
            cl = parser.parse(this.options, this.args);
        } catch (ParseException e) {
            //e.printStackTrace();
            throw e;
        }

        // ----- get options specified ----- //

        this.logfile = cl.getOptionValue(LOG_FILE_PATH_SHORT);
        if (this.logfile == null) {
            this.logfile = "";
        }

        this.logPropFile = cl.getOptionValue(LOG_PROP_FILE_PATH_SHORT);
        if (this.logPropFile == null) {
            this.logPropFile = "";
        }

        this.basicUser = cl.getOptionValue(BASIC_AUTH_USER_LONG);
        if (this.basicUser == null) {
            this.basicUser = "";
        }

        this.basicPassword = cl.getOptionValue(BASIC_AUTH_PASSWORD_LONG);
        if (this.basicPassword == null) {
            this.basicPassword = "";
        }

        this.userAgent = cl.getOptionValue(USER_AGENT_LONG);
        if (this.userAgent == null) {
            this.userAgent = "";
        }

        if (cl.hasOption(HELP_SHORT)) {
            this.hasShowHelp = true;
        }

        @SuppressWarnings("unchecked")
        List<String> leftArgList = cl.getArgList();
        if (!leftArgList.isEmpty()) {
            this.url = leftArgList.get(0);
        }
    }