examples: add getopt argument parsing for client and server