Add code comments for getopt example

Code comments for the major sections of the getopt example program.