public static void main(String[] args) {
        CommandLineParser parser = new PosixParser();

        try {
            CommandLine cmd = parser.parse(options, args);

            PeerClient peerClient = new PeerClient();

            // input stream
            if (cmd.hasOption(inputStreamHost.getOpt()) && cmd.hasOption(inputStreamPort.getOpt())) {
                int port = Integer.valueOf(cmd.getOptionValue(inputStreamPort.getOpt()));
                String host = cmd.getOptionValue(inputStreamHost.getOpt());
                GlobalExecutorService.get().submit(new StreamToBlockConverter(host, port));
            }

            // output stream
            if (cmd.hasOption(clientPort.getOpt())) {
                int port = Integer.valueOf(cmd.getOptionValue(clientPort.getOpt()));
                Settings.get().setPeerPort(port);
                GlobalExecutorService.get().submit(new PeerServer(port));
            }

            if (cmd.hasOption(outputStreamPort.getOpt())) {
                int port = Integer.valueOf(cmd.getOptionValue(outputStreamPort.getOpt()));
                GlobalExecutorService.get().submit(new BlockToStreamConverter(port));
            }

            // tracker
            if (cmd.hasOption(trackerHost.getOpt()) && cmd.hasOption(trackerPort.getOpt())) {
                int port = Integer.valueOf(cmd.getOptionValue(trackerPort.getOpt()));
                String host = cmd.getOptionValue(trackerHost.getOpt());
                GlobalExecutorService.get().submit(new TrackerClient(host, port));
            }

            for (Option option : cmd.getOptions()) {
                System.out.println(option);
            }
        } catch (ParseException e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
    }